Skip to main content

Text

Struct Text 

Source
pub struct Text(pub String);

Tuple Fields§

§0: String

Implementations§

Source§

impl Text

Source

pub fn length(&self) -> usize

Source

pub fn to_uppercase(&self) -> Text

Source

pub fn to_lowercase(&self) -> Text

Source

pub fn as_str(&self) -> &str

Source

pub fn as_string(&self) -> String

Source

pub fn char_at(&self, index: i64) -> Result<char, IndexOutOfBoundsError>

Source

pub fn substring(&self, start: usize, end: usize) -> Option<Text>

Source

pub fn contains(&self, substring: &str) -> bool

Source

pub fn starts_with(&self, prefix: &str) -> bool

Source

pub fn ends_with(&self, suffix: &str) -> bool

Source

pub fn index_of(&self, substring: &str) -> Option<usize>

Source

pub fn last_index_of(&self, substring: &str) -> Option<usize>

Source

pub fn is_empty(&self) -> bool

Source

pub fn trim(&self) -> Text

Source

pub fn trim_start(&self) -> Text

Source

pub fn split(&self, delimiter: &str) -> Vec<Text>

Source

pub fn join(texts: &[Text], separator: &str) -> Text

Source

pub fn repeat(&self, n: usize) -> Text

Source§

impl Text

Source

pub fn clear(&mut self)

Source

pub fn reverse(&mut self)

Source

pub fn push_str(&mut self, s: &str)

Source

pub fn push_char(&mut self, c: char)

Source

pub fn pop_char(&mut self) -> Option<char>

Source

pub fn insert(&mut self, index: usize, s: &str) -> Result<(), String>

Source

pub fn remove(&mut self, index: usize) -> Result<char, String>

Source

pub fn replace(&mut self, from: &str, to: &str)

Source

pub fn replace_range( &mut self, range: Range<usize>, replace_with: &str, ) -> Result<(), String>

Source

pub fn set_char_at( &mut self, index: i64, c: char, ) -> Result<(), IndexOutOfBoundsError>

Trait Implementations§

Source§

impl Add<&Text> for Text

Source§

type Output = Text

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Text) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&str> for Text

Source§

type Output = Text

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &str) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Text> for &Text

Source§

type Output = Text

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Text) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for &Text

Source§

type Output = Text

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Text

Source§

type Output = Text

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign for Text

Allow TypedDatexValue += String and TypedDatexValue += &str This can never panic since the Text::from from string will always succeed

Source§

fn add_assign(&mut self, rhs: Text)

Performs the += operation. Read more
Source§

impl Clone for Text

Source§

fn clone(&self) -> Text

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Text

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Text

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Text

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&str> for Text

The froms are used for this magic. This will automatically convert the Rust types to Text when using the += operator.

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Text

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl From<Text> for CoreValue

Source§

fn from(value: Text) -> Self

Converts to this type from the input type.
Source§

impl From<Text> for StructuralTypeDefinition

Source§

fn from(value: Text) -> Self

Converts to this type from the input type.
Source§

impl Hash for Text

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Text

Source§

fn eq(&self, other: &Text) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Text

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralEq for Text

Source§

fn structural_eq(&self, other: &Self) -> bool

Check if two values are equal, ignoring the type.
Source§

impl Eq for Text

Source§

impl StructuralPartialEq for Text

Auto Trait Implementations§

§

impl Freeze for Text

§

impl RefUnwindSafe for Text

§

impl Send for Text

§

impl Sync for Text

§

impl Unpin for Text

§

impl UnsafeUnpin for Text

§

impl UnwindSafe for Text

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CustomError for T
where T: Display + Debug + Send + Sync + 'static,

Source§

fn as_any(&self) -> &(dyn Any + Send + Sync + 'static)

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + Send + Sync + 'static)

Source§

fn as_box_any(self: Box<T>) -> Box<dyn Any + Send + Sync>

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,