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§
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.