Struct casper_types::CLValue[][src]

pub struct CLValue { /* fields omitted */ }

A Casper 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 unit() -> Self[src]

A convenience method to create CLValue for a unit.

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 DataSize for CLValue[src]

impl Debug for CLValue[src]

impl<'de> Deserialize<'de> for CLValue[src]

impl Eq for CLValue[src]

impl FromBytes for CLValue[src]

impl Hash for CLValue[src]

impl Ord for CLValue[src]

impl PartialEq<CLValue> for CLValue[src]

impl PartialOrd<CLValue> for CLValue[src]

impl Serialize 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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,