zng_ext_config

Type Alias ConfigKey

Source
pub type ConfigKey = Txt;
Expand description

Unique key to a config entry.

Aliased Type§

struct ConfigKey(/* private fields */);

Implementations

Source§

impl Txt

Source

pub const fn from_static(s: &'static str) -> Txt

New text that is a &'static str.

Source

pub const fn from_string(s: String) -> Txt

New text from a String optimized for editing.

If you don’t plan to edit the text after this call consider using from_str instead.

Source

pub fn from_str(s: &str) -> Txt

New cloned from s.

The text will be internally optimized for sharing, if you plan to edit the text after this call consider using from_string instead.

Source

pub fn from_arc(s: Arc<str>) -> Txt

New from a shared arc str.

Note that the text can outlive the Arc, by cloning the string data when modified or to use a more optimal representation, you cannot use the reference count of s to track the lifetime of the text.

Source

pub fn from_char(c: char) -> Txt

New text that is an inlined char.

Source

pub fn from_fmt(args: Arguments<'_>) -> Txt

New text from format_args!, avoids allocation if the text is static (no args) or can fit the inlined representation.

Source

pub const fn repr(&self) -> TxtRepr

Identifies how the text is currently stored.

Source

pub fn to_mut(&mut self) -> &mut String

Acquires a mutable reference to a String buffer.

Converts the text to an internal representation optimized for editing, you can call end_mut after editing to re-optimize the text for sharing.

Source

pub fn end_mut(&mut self)

Convert the inner representation of the string to not be String. After this call the text can be cheaply cloned.

Source

pub fn into_owned(self) -> String

Extracts the owned string.

Turns the text to owned if it was borrowed.

Source

pub fn clear(&mut self)

Calls String::clear if the text is owned, otherwise replaces self with an empty str ("").

Source

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

Removes the last character from the text and returns it.

Returns None if this Txt is empty.

This method only converts to TxtRepr::String if the internal representation is TxtRepr::Arc, other representations are reborrowed.

Source

pub fn truncate(&mut self, new_len: usize)

Shortens this Txt to the specified length.

If new_len is greater than the text’s current length, this has no effect.

This method only converts to TxtRepr::String if the internal representation is TxtRepr::Arc, other representations are reborrowed.

Source

pub fn split_off(&mut self, at: usize) -> Txt

Splits the text into two at the given index.

Returns a new Txt. self contains bytes [0, at), and the returned Txt contains bytes [at, len). at must be on the boundary of a UTF-8 code point.

This method only converts to TxtRepr::String if the internal representation is TxtRepr::Arc, other representations are reborrowed.

Source

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

Push the character to the end of the text.

This method avoids converting to TxtRepr::String when the current text plus char can fit inlined.

Source

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

Push the string to the end of the text.

This method avoids converting to TxtRepr::String when the current text plus char can fit inlined.

Source

pub fn as_str(&self) -> &str

Borrow the text as a string slice.

Source

pub fn as_static_str(&self) -> Option<&'static str>

Copy the inner static str if this text represents one.

Trait Implementations

Source§

impl<'a> Add<&'a str> for Txt

Source§

type Output = Txt

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'a str) -> <Txt as Add<&'a str>>::Output

Performs the + operation. Read more
Source§

impl AddAssign<&str> for Txt

Source§

fn add_assign(&mut self, rhs: &str)

Performs the += operation. Read more
Source§

impl AsRef<[u8]> for Txt

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<OsStr> for Txt

Source§

fn as_ref(&self) -> &OsStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Path> for Txt

Source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<str> for Txt

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<str> for Txt

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
Source§

impl Clone for Txt

Clones the text.

If the inner representation is TxtRepr::String the returned value is in a representation optimized for sharing, either a static empty, an inlined short or an Arc<str> long string.

Source§

fn clone(&self) -> Txt

Returns a copy 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 Txt

Source§

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

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

impl Default for Txt

Source§

fn default() -> Txt

Empty.

Source§

impl Deref for Txt

Source§

type Target = str

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Txt as Deref>::Target

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for Txt

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Txt, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl Display for Txt

Source§

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

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

impl From<&'static str> for Txt

Source§

fn from(value: &'static str) -> Txt

Converts to this type from the input type.
Source§

impl From<Cow<'static, str>> for Txt

Source§

fn from(value: Cow<'static, str>) -> Txt

Converts to this type from the input type.
Source§

impl From<String> for Txt

Source§

fn from(value: String) -> Txt

Converts to this type from the input type.
Source§

impl From<char> for Txt

Source§

fn from(value: char) -> Txt

Converts to this type from the input type.
Source§

impl FromStr for Txt

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Txt, <Txt as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Txt

Source§

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

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 IntoVar<CategoryId> for Txt

Source§

type Var = LocalVar<CategoryId>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> Self::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<CommandScope> for Txt

Source§

fn into_var(self) -> <Txt as IntoVar<CommandScope>>::Var

Widget scope.

Source§

type Var = LocalVar<CommandScope>

Variable type that will wrap the T value. Read more
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<Cow<'static, str>> for Txt

Source§

type Var = LocalVar<Cow<'static, str>>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> <Txt as IntoVar<Cow<'static, str>>>::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<DragDropData> for Txt

Source§

type Var = LocalVar<DragDropData>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> <Txt as IntoVar<DragDropData>>::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<FileDialogFilters> for Txt

Source§

type Var = LocalVar<FileDialogFilters>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> <Txt as IntoVar<FileDialogFilters>>::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<PathBuf> for Txt

Source§

type Var = LocalVar<PathBuf>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> <Txt as IntoVar<PathBuf>>::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<Progress> for Txt

Source§

type Var = LocalVar<Progress>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> <Txt as IntoVar<Progress>>::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<String> for Txt

Source§

type Var = LocalVar<String>

Variable type that will wrap the T value. Read more
Source§

fn into_var(self) -> <Txt as IntoVar<String>>::Var

Converts the source value into a var.
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<WidgetId> for Txt

Source§

fn into_var(self) -> <Txt as IntoVar<WidgetId>>::Var

Source§

type Var = LocalVar<WidgetId>

Variable type that will wrap the T value. Read more
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl IntoVar<WindowId> for Txt

Source§

fn into_var(self) -> <Txt as IntoVar<WindowId>>::Var

Source§

type Var = LocalVar<WindowId>

Variable type that will wrap the T value. Read more
Source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
Source§

impl Ord for Txt

Source§

fn cmp(&self, other: &Txt) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<&str> for Txt

Source§

fn eq(&self, other: &&str) -> 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 PartialEq<String> for Txt

Source§

fn eq(&self, other: &String) -> 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 PartialEq<str> for Txt

Source§

fn eq(&self, other: &str) -> 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 PartialEq for Txt

Source§

fn eq(&self, other: &Txt) -> 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 PartialOrd for Txt

Source§

fn partial_cmp(&self, other: &Txt) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Txt

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

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

impl Write for Txt

Source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · Source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
Source§

impl Eq for Txt

Source§

impl IntoValue<CategoryId> for Txt

Source§

impl IntoValue<CommandScope> for Txt

Source§

impl IntoValue<Cow<'static, str>> for Txt

Source§

impl IntoValue<DragDropData> for Txt

Source§

impl IntoValue<FileDialogFilters> for Txt

Source§

impl IntoValue<PathBuf> for Txt

Source§

impl IntoValue<Progress> for Txt

Source§

impl IntoValue<String> for Txt

Source§

impl IntoValue<WidgetId> for Txt

Source§

impl IntoValue<WindowId> for Txt

Source§

impl StructuralPartialEq for Txt