pub struct LangString {
pub language: String,
pub text: String,
}Fields§
§language: String§text: StringImplementations§
Trait Implementations§
Source§impl Clone for LangString
impl Clone for LangString
Source§fn clone(&self) -> LangString
fn clone(&self) -> LangString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LangString
impl Debug for LangString
Source§impl<'de> Deserialize<'de> for LangString
impl<'de> Deserialize<'de> for LangString
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for LangString
impl FromStr for LangString
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
The specification mentions an RDF/Turtle syntax that looks like this: “Hello”@en
This implementation of from_str takes a &str in this syntax and returns the LangString or Err.
§Example
use std::str::FromStr;
use basyx_rs::LangString;
let expected = LangString::new("EN".to_string(), "Current temperature".to_string());
let actual = LangString::from_str("\"Current temperature\"@EN").ok().unwrap();
assert_eq!(actual, expected);Source§impl PartialEq for LangString
impl PartialEq for LangString
Source§impl Serialize for LangString
impl Serialize for LangString
impl StructuralPartialEq for LangString
Auto Trait Implementations§
impl Freeze for LangString
impl RefUnwindSafe for LangString
impl Send for LangString
impl Sync for LangString
impl Unpin for LangString
impl UnwindSafe for LangString
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