[][src]Struct solana_libra_vm::vm_string::VMString

pub struct VMString(_);

An owned string in a Move transaction.

For more details, see the module level documentation.

Methods

impl VMString[src]

pub fn new(s: impl Into<Box<str>>) -> Self[src]

Creates a new VMString instance.

pub fn from_utf8(vec: Vec<u8>) -> Result<Self, FromUtf8Error>[src]

Converts a vector of bytes to a VMString.

pub fn as_vm_str(&self) -> &VMStr[src]

Creates a borrowed version of self.

pub fn into_string(self) -> String[src]

Converts this VMString into a String.

This is not implemented as a From trait to discourage automatic conversions -- these conversions should not typically happen.

pub fn into_bytes(self) -> Vec<u8>[src]

Converts this VMString into a UTF-8-encoded byte sequence.

Methods from Deref<Target = VMStr>

pub fn len(&self) -> usize[src]

Returns the length of self in bytes.

pub fn is_empty(&self) -> bool[src]

Returns true if self has a length of zero bytes.

pub fn as_str(&self) -> &str[src]

Converts self to a &str.

This is not implemented as a From trait to discourage automatic conversions -- these conversions should not typically happen.

pub fn as_bytes(&self) -> &[u8][src]

Converts self to a byte slice.

Trait Implementations

impl AsRef<VMStr> for VMString[src]

impl Borrow<VMStr> for VMString[src]

impl CanonicalDeserialize for VMString[src]

impl CanonicalSerialize for VMString[src]

LCS does not define any sort of extra annotation for VM strings -- they're serialized exactly the same way regular strings are, and are represented only within the type system for now.

impl Clone for VMString[src]

impl Debug for VMString[src]

impl Deref for VMString[src]

type Target = VMStr

The resulting type after dereferencing.

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

impl Display for VMString[src]

impl Eq for VMString[src]

impl<'a> From<&'a VMStr> for VMString[src]

impl<'a> From<&'a str> for VMString[src]

impl From<Box<str>> for VMString[src]

impl From<String> for VMString[src]

impl Hash for VMString[src]

impl Ord for VMString[src]

impl PartialEq<VMString> for VMString[src]

impl PartialOrd<VMString> for VMString[src]

impl Serialize for VMString[src]

impl StructuralEq for VMString[src]

impl StructuralPartialEq for VMString[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> TestOnlyHash for T where
    T: Serialize + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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>,