Skip to main content

StringStrategy

Trait StringStrategy 

Source
pub trait StringStrategy: Clone + Default {
    // Required methods
    fn new() -> Self;
    fn prepare(&self, s: &str) -> String;
    fn len(&self, s: &str) -> usize;
    fn remove(&self, s: &str, index: usize) -> String;
    fn slice(&self, s: &str, start: usize, end: usize) -> String;
    fn suffix(&self, s: &str, start: usize) -> String;
    fn at(&self, s: &str, i: isize) -> Option<char>;
}

Required Methods§

Source

fn new() -> Self

Source

fn prepare(&self, s: &str) -> String

Source

fn len(&self, s: &str) -> usize

Source

fn remove(&self, s: &str, index: usize) -> String

Source

fn slice(&self, s: &str, start: usize, end: usize) -> String

Source

fn suffix(&self, s: &str, start: usize) -> String

Source

fn at(&self, s: &str, i: isize) -> Option<char>

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.

Implementors§