[−][src]Struct solana_libra_vm::vm_string::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]
fn deserialize(deserializer: &mut impl CanonicalDeserializer) -> Result<Self>
[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.
fn serialize(&self, serializer: &mut impl CanonicalSerializer) -> Result<()>
[src]
impl Clone for VMString
[src]
impl Debug for VMString
[src]
impl Deref for VMString
[src]
impl<'de> Deserialize<'de> for VMString
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for VMString
[src]
fn cmp(&self, other: &VMString) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<VMString> for VMString
[src]
impl PartialOrd<VMString> for VMString
[src]
fn partial_cmp(&self, other: &VMString) -> Option<Ordering>
[src]
fn lt(&self, other: &VMString) -> bool
[src]
fn le(&self, other: &VMString) -> bool
[src]
fn gt(&self, other: &VMString) -> bool
[src]
fn ge(&self, other: &VMString) -> bool
[src]
impl Serialize for VMString
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for VMString
[src]
impl StructuralPartialEq for VMString
[src]
Auto Trait Implementations
impl RefUnwindSafe for VMString
impl Send for VMString
impl Sync for VMString
impl Unpin for VMString
impl UnwindSafe for VMString
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
fn test_only_hash(&self) -> HashValue
[src]
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,