Expand description
Locutus stdlib prelude.
Re-exports§
pub use crate::delegate_host::decode_secret_key_list;pub use crate::delegate_host::encode_secret_key_list;pub use crate::delegate_host::error_codes;pub use crate::delegate_host::DelegateCtx;pub use bincode;pub use blake3;pub use serde_json;pub use tracing;pub use tracing_subscriber;
Modules§
- encoding
- Helper types for interaction between wasm and host boundaries.
Structs§
- Application
Message - Bincode
Encoder - Client
Response - Code
Hash - Contract
- A complete contract specification requires a
parameterssection and acontractsection. - Contract
Code - The executable contract.
- Contract
Instance Id - The key representing the hash of the contract executable code hash and a set of
parameters. - Contract
Key - A complete key specification, that represents a cryptographic hash that identifies the contract.
- Contract
Notification - Notification delivered to a delegate when a subscribed contract’s state changes.
- Delegate
- Delegate
Code - Executable delegate
- Delegate
Context - Delegate
Interface Result - Delegate
Key - Delegate
Manifest - What a delegate declares it wants from the node.
- Delegate
Message - A message sent from one delegate to another.
- GetContract
Request - Request to get contract state from within a delegate.
- GetContract
Response - Response containing contract state for a delegate.
- Json
Encoder - Notification
Message - Parameters
- Data that forms part of a contract or a delegate along with the WebAssembly code.
- PutContract
Request - Request to store a new contract from within a delegate.
- PutContract
Response - Response after attempting to store a contract from a delegate.
- Related
Contract - A contract related to an other contract and the specification of the kind of update notifications that should be received by this contract.
- Related
Contracts - The contracts related to a parent or root contract. Tipically this means contracts which state requires to be verified or integrated in some way with the parent contract.
- Related
Contracts Container - Secrets
Id - State
- State
Delta - Represents a modification to some state - similar to a diff in source code.
- State
Summary - Summary of
Statechanges. - Subscribe
Contract Request - Request to subscribe to a contract’s state changes from within a delegate.
- Subscribe
Contract Response - Response after attempting to subscribe to a contract from a delegate.
- Unsubscribe
Contract Request - Request to stop receiving a contract’s state changes, from within a delegate.
- Unsubscribe
Contract Response - Response after attempting to unsubscribe from a contract from a delegate.
- Update
Contract Request - Request to update an existing contract’s state from within a delegate.
- Update
Contract Response - Response after attempting to update a contract from a delegate.
- Update
Modification - An update to a contract state or any required related contracts to update that state.
- User
Input Request - User
Input Response - Wakeup
Schedule - One periodic wake-up a delegate asks for.
- Wrapped
Contract - Just as
freenet_stdlib::Contractbut with some convenience impl. - Wrapped
State - The state for a contract.
Enums§
- APIVersion
- Marked
#[non_exhaustive]so future protocol versions can be added without a source-level break. Downstreammatchsites must include a wildcard arm. Historical note: an earlier release hadAPIVersion::from_u64panic on unknown versions; both the panic fix (0.1.8) and this attribute reduce the blast radius of version evolution. - Capability
- A node-enforced capability, granted by the user once per app.
- Contract
Container - Wrapper that allows contract versioning. This enum maintains the types of contracts that are allowed and their corresponding version.
- Contract
Error - Type of errors during interaction with a contract.
- Contract
WasmAPI Version - Contains the different versions available for WASM contracts.
- Delegate
Container - Delegate
Error - Type of errors during interaction with a delegate.
- Delegate
WasmAPI Version - Contains the different versions available for WASM delegates.
- Inbound
Delegate Msg - Messages delivered into a delegate’s
process()function. - Lifecycle
Event - A lifecycle event, delivered as
InboundDelegateMsg::Lifecycle. - Lifecycle
Kind - A kind of
LifecycleEventa delegate can ask to receive. - Manifest
Error - Why a manifest could not be read.
- Message
Origin - Identifies where an inbound application message originated from.
- Outbound
Delegate Msg - Messages emitted out of a delegate’s
process()function. - Related
Mode - Specification of the notifications of interest from a related contract.
- Update
Data - Update notifications for a contract or a related contract.
- Validate
Result - The result of calling the [
ContractInterface::validate_state] function. - Version
Error
Constants§
- MANIFEST_
SECTION_ NAME - Name of the WASM custom section holding the manifest.
- MANIFEST_
VERSION - The manifest format version this stdlib writes.
- MAX_
MANIFEST_ BYTES - Largest manifest payload a reader accepts, in bytes. A manifest is a handful of short names; anything bigger is not a manifest.
- MAX_
WAKEUPS - Most wake-up schedules one delegate may declare. Entries past this are ignored.
- MAX_
WAKEUP_ INTERVAL_ SECS - Longest wake-up interval, in seconds (7 days). A longer one is treated as this. Wake-ups are re-armed when a node starts rather than remembered across restarts, so a very long interval would mostly measure node uptime anyway.
- MAX_
WAKEUP_ TAG_ BYTES - Longest wake-up tag, in bytes. Entries with a longer (or empty) tag are ignored.
- MIN_
WAKEUP_ INTERVAL_ SECS - Shortest wake-up interval a node honours, in seconds. A manifest asking for
less is treated as asking for this (see
DelegateManifest::effective_wakeups).
Traits§
- Contract
Interface - Trait to implement for the contract building.
- Delegate
Interface - A Delegate is a webassembly code designed to act as an agent for the user on Freenet. Delegates can:
- Encoder
- Encoding
Adapter - A contract state and it’s associated types which can be encoded and decoded via an specific encoder.