pub struct Ref {
pub value: String,
pub dis: Option<String>,
}Expand description
Haystack Ref
§Example
Create Ref value
use libhaystack::val::*;
// Create ref from `&str` primitive
let ref_value = Value::from(Ref::from("exampleRef"));
assert!(ref_value.is_ref());
// Ref with display
let ref_dis_value = Value::from(Ref{ value: String::from("myRef"), dis: Some(String::from("sample ref")) });
assert_eq!(Ref::try_from(&ref_dis_value).unwrap().dis, Some(String::from("sample ref")));Fields§
§value: String§dis: Option<String>Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ref
Hayson Ref deserializer
impl<'de> Deserialize<'de> for Ref
Hayson Ref deserializer
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Ref, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Ref, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Ref
Implement ordering used in sorting for Ref
impl Ord for Ref
Implement ordering used in sorting for Ref
Source§impl PartialOrd for Ref
Implement partial ordering used in sorting for Ref
impl PartialOrd for Ref
Implement partial ordering used in sorting for Ref
impl Eq for Ref
Auto Trait Implementations§
impl Freeze for Ref
impl RefUnwindSafe for Ref
impl Send for Ref
impl Sync for Ref
impl Unpin for Ref
impl UnsafeUnpin for Ref
impl UnwindSafe for Ref
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