[−][src]Struct casperlabs_types::CLValue
A CasperLabs value, i.e. a value which can be stored and manipulated by smart contracts.
It holds the underlying data as a type-erased, serialized Vec<u8>
and also holds the
CLType
of the underlying data as a separate member.
Implementations
impl CLValue
[src]
pub fn from_t<T: CLTyped + ToBytes>(t: T) -> Result<CLValue, CLValueError>
[src]
Constructs a CLValue
from t
.
pub fn into_t<T: CLTyped + FromBytes>(self) -> Result<T, CLValueError>
[src]
Consumes and converts self
back into its underlying type.
pub fn cl_type(&self) -> &CLType
[src]
The CLType
of the underlying data.
pub fn inner_bytes(&self) -> &Vec<u8>
[src]
Returns a reference to the serialized form of the underlying value held in this CLValue
.
pub fn serialized_length(&self) -> usize
[src]
Returns the length of the Vec<u8>
yielded after calling self.to_bytes()
.
Note, this method doesn't actually serialize self
, and hence is relatively cheap.
Trait Implementations
impl Clone for CLValue
[src]
impl Debug for CLValue
[src]
impl Eq for CLValue
[src]
impl FromBytes for CLValue
[src]
fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>
[src]
fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>
[src]
impl PartialEq<CLValue> for CLValue
[src]
impl StructuralEq for CLValue
[src]
impl StructuralPartialEq for CLValue
[src]
impl ToBytes for CLValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for CLValue
impl Send for CLValue
impl Sync for CLValue
impl Unpin for CLValue
impl UnwindSafe for CLValue
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,