[][src]Trait idata::IString

pub trait IString {
    fn ipush(self, ch: char) -> String;
fn iappend(self, txt: &str) -> String;
fn ipop(self) -> Option<String>; }

Operations on inmutable vars over an string

Required methods

fn ipush(self, ch: char) -> String

Add a char to a String

  extern crate idata;
  use idata::IString;

  fn main() {
       let s = "Hello world".to_string();
       let s = s.ipush('!');

       assert!(s == "Hello world!");
  }

fn iappend(self, txt: &str) -> String

Add a &str to a String

  extern crate idata;
  use idata::IString;

  fn main() {
       let s = "Hello world".to_string();
       let s = s.iappend("!!!");

       assert!(s == "Hello world!!!");
  }

fn ipop(self) -> Option<String>

Remove a char from a String

  extern crate idata;
  use idata::IString;

  fn main() {
       let s = "Hello world!".to_string();
       let s = s.ipop().unwrap();

       assert!(s == "Hello world");
  }
Loading content...

Implementations on Foreign Types

impl IString for String[src]

Loading content...

Implementors

Loading content...