[−][src]Enum wasm_rpc::ObjectKey
A simplified CBOR value containing only types useful for keys.
Variants
Integer(i64)
An integer.
Bytes(Vec<u8>)
A byte string.
String(String)
An UTF-8 string.
Bool(bool)
A boolean value.
Null
No value.
Methods
impl ObjectKey
[src]
pub fn is_bytes(&self) -> bool
[src]
Returns true if the ObjectKey is a byte string.
pub fn as_bytes(&self) -> Option<&Vec<u8>>
[src]
Returns the associated byte string or None
if the ObjectKey has a different type.
pub fn as_bytes_mut(&mut self) -> Option<&mut Vec<u8>>
[src]
Returns the associated mutable byte string or None
if the ObjectKey has a different type.
pub fn is_string(&self) -> bool
[src]
Returns true if the ObjectKey is a string.
pub fn as_string(&self) -> Option<&String>
[src]
Returns the associated string or None
if the *ObjectKey` has a different type.
pub fn as_string_mut(&mut self) -> Option<&mut String>
[src]
Returns the associated mutable string or None
if the ObjectKey
has a different type.
pub fn is_number(&self) -> bool
[src]
Retrns true if the ObjectKey
is a number.
pub fn as_i64(&self) -> Option<i64>
[src]
If the ObjectKey
is a number, return or cast it to a i64. Returns None otherwise.
pub fn as_u64(&self) -> Option<u64>
[src]
If the ObjectKey
is a number, return or cast it to a u64. Returns None otherwise.
pub fn is_boolean(&self) -> bool
[src]
Returns true if the ObjectKey is a boolean.
pub fn as_boolean(&self) -> Option<bool>
[src]
If the ObjectKey is a Boolean, returns the associated bool. Returns None otherwise.
pub fn is_null(&self) -> bool
[src]
Returns true if the ObjectKey is a Null. Returns false otherwise.
pub fn as_null(&self) -> Option<()>
[src]
If the ObjectKey is a Null, returns (). Returns None otherwise.
Trait Implementations
impl Eq for ObjectKey
[src]
impl<'de> Deserialize<'de> for ObjectKey
[src]
fn deserialize<D>(
deserializer: D
) -> Result<ObjectKey, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<ObjectKey, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Clone for ObjectKey
[src]
fn clone(&self) -> ObjectKey
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<ObjectKey> for ObjectKey
[src]
impl Debug for ObjectKey
[src]
impl Serialize for ObjectKey
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl PartialOrd<ObjectKey> for ObjectKey
[src]
fn partial_cmp(&self, other: &ObjectKey) -> Option<Ordering>
[src]
fn lt(&self, other: &ObjectKey) -> bool
[src]
fn le(&self, other: &ObjectKey) -> bool
[src]
fn gt(&self, other: &ObjectKey) -> bool
[src]
fn ge(&self, other: &ObjectKey) -> bool
[src]
impl Ord for ObjectKey
[src]
fn cmp(&self, other: &ObjectKey) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl From<bool> for ObjectKey
[src]
impl From<Vec<u8>> for ObjectKey
[src]
impl From<i64> for ObjectKey
[src]
impl From<ObjectKey> for Value
[src]
impl From<String> for ObjectKey
[src]
impl From<Value> for ObjectKey
[src]
impl Hash for ObjectKey
[src]
Auto Trait Implementations
impl Sync for ObjectKey
impl Unpin for ObjectKey
impl Send for ObjectKey
impl UnwindSafe for ObjectKey
impl RefUnwindSafe for ObjectKey
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[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, 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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,