[][src]Enum abin::StrSegment

pub enum StrSegment<'a, TBin: AnyBin> {
    Slice(&'a str),
    Static(&'static str),
    Str(AnyStr<TBin>),
    GivenString(String),
    Char(char),
    Empty,
}

A segment; segments can be joined to create strings. See StrBuilder, SegmentIterator and SegmentsSlice.

use abin::{NewStr, StrSegment, Str, StrBuilder};

let mut builder = NewStr::builder();
builder.push(StrSegment::Static("Hello, "));
builder.push(StrSegment::Static("World!"));
let string : Str = builder.build();

assert_eq!("Hello, World!", string.as_str());

Variants

Slice(&'a str)
Static(&'static str)
Str(AnyStr<TBin>)
GivenString(String)
Char(char)
Empty

Trait Implementations

impl<'a, TBin: Clone + AnyBin> Clone for StrSegment<'a, TBin>[src]

impl<'a, TBin: Debug + AnyBin> Debug for StrSegment<'a, TBin>[src]

impl<'a, TBin: AnyBin> From<&'static str> for StrSegment<'a, TBin>[src]

impl<'a, TBin: AnyBin> From<AnyStr<TBin>> for StrSegment<'a, TBin>[src]

impl<'a, TBin: AnyBin> From<String> for StrSegment<'a, TBin>[src]

impl<'a, TBin: AnyBin> From<char> for StrSegment<'a, TBin>[src]

impl<'a, TBin: AnyBin> Into<BinSegment<'a, TBin>> for StrSegment<'a, TBin>[src]

impl<'a, TBin: AnyBin> Segment for StrSegment<'a, TBin>[src]

Auto Trait Implementations

impl<'a, TBin> RefUnwindSafe for StrSegment<'a, TBin> where
    TBin: RefUnwindSafe

impl<'a, TBin> Send for StrSegment<'a, TBin> where
    TBin: Send

impl<'a, TBin> Sync for StrSegment<'a, TBin> where
    TBin: Sync

impl<'a, TBin> Unpin for StrSegment<'a, TBin> where
    TBin: Unpin

impl<'a, TBin> UnwindSafe for StrSegment<'a, TBin> where
    TBin: UnwindSafe

Blanket Implementations

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

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

impl<T> BorrowMut<T> for T where
    T: ?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.