pub enum OffchainMessage {
V0(OffchainMessage),
}Variantsยง
Implementationsยง
Sourceยงimpl OffchainMessage
impl OffchainMessage
pub const SIGNING_DOMAIN: &'static [u8] = b"\xffsolana offchain"
pub const HEADER_LEN: usize = 17usize
Sourcepub fn new(
version: u8,
message: &[u8],
) -> Result<OffchainMessage, SanitizeError>
pub fn new( version: u8, message: &[u8], ) -> Result<OffchainMessage, SanitizeError>
Construct a new OffchainMessage object from the given version and message
Sourcepub fn serialize(&self) -> Result<Vec<u8>, SanitizeError>
pub fn serialize(&self) -> Result<Vec<u8>, SanitizeError>
Serialize the off-chain message to bytes including full header
Sourcepub fn deserialize(data: &[u8]) -> Result<OffchainMessage, SanitizeError>
pub fn deserialize(data: &[u8]) -> Result<OffchainMessage, SanitizeError>
Deserialize the off-chain message from bytes that include full header
Sourcepub fn hash(&self) -> Result<Hash, SanitizeError>
pub fn hash(&self) -> Result<Hash, SanitizeError>
Compute the hash of the off-chain message
pub fn get_version(&self) -> u8
pub fn get_format(&self) -> MessageFormat
pub fn get_message(&self) -> &Vec<u8> โ
Trait Implementationsยง
Sourceยงimpl Clone for OffchainMessage
impl Clone for OffchainMessage
Sourceยงfn clone(&self) -> OffchainMessage
fn clone(&self) -> OffchainMessage
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSourceยงimpl Debug for OffchainMessage
impl Debug for OffchainMessage
Sourceยงimpl PartialEq for OffchainMessage
impl PartialEq for OffchainMessage
impl Eq for OffchainMessage
impl StructuralPartialEq for OffchainMessage
Auto Trait Implementationsยง
impl Freeze for OffchainMessage
impl RefUnwindSafe for OffchainMessage
impl Send for OffchainMessage
impl Sync for OffchainMessage
impl Unpin for OffchainMessage
impl UnwindSafe for OffchainMessage
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.Sourceยงimpl<T> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Sourceยงfn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Sourceยงimpl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Sourceยงfn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.