pub trait ContractAbi {
type Operation: Serialize + DeserializeOwned + Send + Sync + Debug + 'static;
type Response: Serialize + DeserializeOwned + Send + Sync + Debug + 'static;
// Provided methods
fn deserialize_operation(
operation: Vec<u8>,
) -> Result<Self::Operation, String> { ... }
fn serialize_operation(
operation: &Self::Operation,
) -> Result<Vec<u8>, String> { ... }
fn deserialize_response(response: Vec<u8>) -> Result<Self::Response, String> { ... }
fn serialize_response(response: Self::Response) -> Result<Vec<u8>, String> { ... }
}
Expand description
A trait that includes all the types exported by a Linera application contract.
Required Associated Types§
Sourcetype Operation: Serialize + DeserializeOwned + Send + Sync + Debug + 'static
type Operation: Serialize + DeserializeOwned + Send + Sync + Debug + 'static
The type of operation executed by the application.
Operations are transactions directly added to a block by the creator (and signer) of the block. Users typically use operations to start interacting with an application on their own chain.
Provided Methods§
Sourcefn deserialize_operation(operation: Vec<u8>) -> Result<Self::Operation, String>
fn deserialize_operation(operation: Vec<u8>) -> Result<Self::Operation, String>
How the Operation
is deserialized
Sourcefn serialize_operation(operation: &Self::Operation) -> Result<Vec<u8>, String>
fn serialize_operation(operation: &Self::Operation) -> Result<Vec<u8>, String>
How the Operation
is serialized
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.