Skip to main content

FormatBuf

Trait FormatBuf 

Source
pub trait FormatBuf:
    Extend<Self::Char>
    + Default
    + FromIterator<Self::Char>
    + From<String> {
    type Char: FormatChar;

    // Required methods
    fn chars(&self) -> impl Iterator<Item = Self::Char>;
    fn len(&self) -> usize;
    fn concat(self, other: Self) -> Self;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn chars(&self) -> impl Iterator<Item = Self::Char>

Source

fn len(&self) -> usize

Source

fn concat(self, other: Self) -> Self

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FormatBuf for String

Source§

type Char = char

Source§

fn chars(&self) -> impl Iterator<Item = Self::Char>

Source§

fn len(&self) -> usize

Source§

fn concat(self, other: Self) -> Self

Source§

impl FormatBuf for Vec<u8>

Source§

type Char = u8

Source§

fn chars(&self) -> impl Iterator<Item = Self::Char>

Source§

fn len(&self) -> usize

Source§

fn concat(self, other: Self) -> Self

Source§

impl FormatBuf for Wtf8Buf

Source§

type Char = CodePoint

Source§

fn chars(&self) -> impl Iterator<Item = Self::Char>

Source§

fn len(&self) -> usize

Source§

fn concat(self, other: Self) -> Self

Implementors§