[][src]Struct fastobo::ast::UnquotedString

pub struct UnquotedString { /* fields omitted */ }

A string without delimiters, used as values in different clauses.

This type is mostly just a wrapper for String that patches FromStr and Display so that it can read and write unquoted strings in OBO documents.

Usage

Use FromStr to parse the serialized representation of a UnquotedString, and UnquotedString::new to create a quoted string with its content set from a Rust String passed as argument.

To get the the unescaped String, use UnquotedString::into_string, or use ToString::to_string to obtained a serialized (escaped) version of the unquoted string.

Example

let s = UnquotedString::new("Hello, world!");
assert_eq!(s.to_string(), "Hello, world!");

Methods

impl UnquotedString[src]

pub fn new<S>(s: S) -> Self where
    S: Into<String>, 
[src]

Create a new UnquotedString from an unescaped string.

pub fn as_str(&self) -> &str[src]

Extracts a string slice containing the UnquotedString value.

pub fn into_string(self) -> String[src]

Retrieve the underlying unescaped string from the UnquotedString.

Methods from Deref<Target = UnquotedStr>

Trait Implementations

impl<'i> FromPair<'i> for UnquotedString[src]

fn from_pair(pair: Pair<'i, Rule>) -> Result<Self, Error>[src]

Create a new instance from a Pair.

impl<'a> Share<'a, &'a UnquotedStr> for UnquotedString[src]

impl AsRef<String> for UnquotedString[src]

impl AsRef<UnquotedString> for UnquotedString[src]

impl AsRef<str> for UnquotedString[src]

impl AsRef<UnquotedStr> for UnquotedString[src]

impl Clone for UnquotedString[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for UnquotedString[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl From<String> for UnquotedString[src]

impl<'_> From<&'_ str> for UnquotedString[src]

impl Eq for UnquotedString[src]

impl Into<String> for UnquotedString[src]

impl PartialOrd<UnquotedString> for UnquotedString[src]

impl PartialEq<UnquotedString> for UnquotedString[src]

impl Deref for UnquotedString[src]

type Target = UnquotedStr

The resulting type after dereferencing.

impl Debug for UnquotedString[src]

impl Display for UnquotedString[src]

impl FromStr for UnquotedString[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for UnquotedString[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Borrow<UnquotedStr> for UnquotedString[src]

impl OpaqueTypedef for UnquotedString[src]

type Inner = String

Inner type.

type Error = Infallible

Validation error type.

Auto Trait Implementations

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]