pub struct EncodedOperation(/* private fields */);Expand description
Wrapper type for operation bytes.
This struct can be used to deserialize an hex-encoded string into bytes when using a human-readable encoding format. No validation is applied whatsoever, except of checking if it is a valid hex-string (#OP1).
To validate these bytes use the decode_operation method to get an PlainOperation instance.
From there you can derive a Schema to finally validate the operation with
validate_operation. Read the module-level documentation for more information.
Implementations§
Source§impl EncodedOperation
impl EncodedOperation
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Returns new EncodedOperation instance from given bytes.
This does not apply any validation and should only be used in methods where all checks have taken place before.
Sourcepub fn into_bytes(&self) -> Vec<u8> ⓘ
pub fn into_bytes(&self) -> Vec<u8> ⓘ
Returns operation as bytes.
Trait Implementations§
Source§impl Clone for EncodedOperation
impl Clone for EncodedOperation
Source§fn clone(&self) -> EncodedOperation
fn clone(&self) -> EncodedOperation
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 EncodedOperation
impl Debug for EncodedOperation
Source§impl<'de> Deserialize<'de> for EncodedOperation
impl<'de> Deserialize<'de> for EncodedOperation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EncodedOperation
impl Display for EncodedOperation
Source§impl Hash for EncodedOperation
impl Hash for EncodedOperation
Source§impl PartialEq for EncodedOperation
impl PartialEq for EncodedOperation
Source§impl Serialize for EncodedOperation
impl Serialize for EncodedOperation
impl Eq for EncodedOperation
impl StructuralPartialEq for EncodedOperation
Auto Trait Implementations§
impl Freeze for EncodedOperation
impl RefUnwindSafe for EncodedOperation
impl Send for EncodedOperation
impl Sync for EncodedOperation
impl Unpin for EncodedOperation
impl UnwindSafe for EncodedOperation
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<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 more