Trait owoify_rs::Owoifiable

source ·
pub trait Owoifiable {
    type ResultType;

    // Required methods
    fn owoify(&self, level: OwoifyLevel) -> Self::ResultType;
    fn uwuify(&self) -> Self::ResultType;
    fn uvuify(&self) -> Self::ResultType;
}
Expand description

A trait that could be implemented to owoify any ASCII string to babyspeak gibberish using the given owoness level (OwoifyLevel).

Required Associated Types§

Required Methods§

source

fn owoify(&self, level: OwoifyLevel) -> Self::ResultType

Owoifies the source using the specified owoness level and returns a new String.

source

fn uwuify(&self) -> Self::ResultType

Owoifies the source using Uwu owoness.

source

fn uvuify(&self) -> Self::ResultType

Owoifies the source using Uvu owoness.

Implementations on Foreign Types§

source§

impl Owoifiable for &str

source§

fn owoify(&self, level: OwoifyLevel) -> Self::ResultType

Owoifies the given string literal using specified owoness level and returns a new String.

Examples
use owoify_rs::{Owoifiable, OwoifyLevel};

let result = "Hello, World! Rust is fun!".owoify(OwoifyLevel::Owo);
assert_ne!("Hello, World! Rust is fun!", result);
§

type ResultType = String

source§

fn uwuify(&self) -> Self::ResultType

source§

fn uvuify(&self) -> Self::ResultType

source§

impl Owoifiable for &[u8]

source§

fn owoify(&self, level: OwoifyLevel) -> Self::ResultType

Owoifies the given string in byte slice form with invalid sequences replaced with U+FFFD REPLACEMENT CHARACTER. Returns a new String.

§

type ResultType = String

source§

fn uwuify(&self) -> Self::ResultType

source§

fn uvuify(&self) -> Self::ResultType

source§

impl Owoifiable for String

source§

fn owoify(&self, level: OwoifyLevel) -> Self::ResultType

Owoifies the given string using specified owoness level and returns a new String.

Examples
use owoify_rs::{Owoifiable, OwoifyLevel};

let source = "Hello, World! Rust is fun!".to_string();
let result = source.owoify(OwoifyLevel::Owo);
assert_ne!(source, result);
§

type ResultType = String

source§

fn uwuify(&self) -> Self::ResultType

source§

fn uvuify(&self) -> Self::ResultType

source§

impl Owoifiable for Vec<u8>

source§

fn owoify(&self, level: OwoifyLevel) -> Self::ResultType

Owoifies the given string in bytes. The bytes are cloned and will return a new String. Returns a Result<String, FromUtf8Error>.

§

type ResultType = Result<String, FromUtf8Error>

source§

fn uwuify(&self) -> Self::ResultType

source§

fn uvuify(&self) -> Self::ResultType

Implementors§