pub struct Str {
pub value: String,
}Expand description
Haystack Str
§Example
Create Str value
use libhaystack::val::*;
// Create `Str` from `&str` primitive
let str_value = Value::from(Str::from("sample string"));
assert!(str_value.is_str());
// Get the `Str` value from the Value
assert_eq!(Str::try_from(&str_value).unwrap(), Str::from("sample string"));
// Get a std::String from a Value
assert_eq!(String::try_from(&str_value).unwrap(), "sample string");
// Create `Str` from literal
let str:Str = "sample string".into();
assert_eq!(str.as_str(), "sample string");Fields§
§value: StringImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Str
Hayson Str deserializer
impl<'de> Deserialize<'de> for Str
Hayson Str deserializer
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Str, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Str, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Str
impl Ord for Str
Source§impl PartialOrd for Str
impl PartialOrd for Str
impl Eq for Str
impl StructuralPartialEq for Str
Auto Trait Implementations§
impl Freeze for Str
impl RefUnwindSafe for Str
impl Send for Str
impl Sync for Str
impl Unpin for Str
impl UnwindSafe for Str
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more