Struct GodotString

Source
pub struct GodotString(/* private fields */);
Expand description

Godot’s reference-counted string type.

Implementations§

Source§

impl GodotString

Source

pub fn new() -> GodotString

Source

pub fn from_str<S>(s: S) -> GodotString
where S: AsRef<str>,

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn is_numeric(&self) -> bool

Source

pub fn is_valid_float(&self) -> bool

Source

pub fn is_valid_html_color(&self) -> bool

Source

pub fn is_valid_identifier(&self) -> bool

Source

pub fn is_valid_integer(&self) -> bool

Source

pub fn is_valid_ip_address(&self) -> bool

Source

pub fn is_resource_file(&self) -> bool

Source

pub fn is_absolute_path(&self) -> bool

Source

pub fn is_relative_path(&self) -> bool

Source

pub fn to_f32(&self) -> f32

Source

pub fn to_f64(&self) -> f64

Source

pub fn to_i32(&self) -> i32

Source

pub fn u32_hash(&self) -> u32

Source

pub fn u64_hash(&self) -> u64

Source

pub fn hex_to_int(&self) -> i32

Source

pub fn hex_to_int_without_prefix(&self) -> i32

Source

pub fn camelcase_to_underscore(&self) -> GodotString

Source

pub fn camelcase_to_underscore_lowercased(&self) -> GodotString

Source

pub fn capitalize(&self) -> GodotString

Source

pub fn to_lowercase(&self) -> GodotString

Source

pub fn to_uppercase(&self) -> GodotString

Source

pub fn get_file(&self) -> GodotString

Source

pub fn get_base_dir(&self) -> GodotString

Source

pub fn simplify_path(&self) -> GodotString

Source

pub fn sha256_text(&self) -> GodotString

Source

pub fn md5_text(&self) -> GodotString

Source

pub fn c_escape(&self) -> GodotString

Source

pub fn c_escape_multiline(&self) -> GodotString

Source

pub fn c_unescape(&self) -> GodotString

Source

pub fn http_escape(&self) -> GodotString

Source

pub fn http_unescape(&self) -> GodotString

Source

pub fn json_escape(&self) -> GodotString

Source

pub fn xml_escape(&self) -> GodotString

Source

pub fn xml_escape_with_quotes(&self) -> GodotString

Source

pub fn xml_unescape(&self) -> GodotString

Source

pub fn percent_decode(&self) -> GodotString

Source

pub fn percent_encode(&self) -> GodotString

Source

pub fn is_valid_hex_number(&self, with_prefix: bool) -> bool

Source

pub fn begins_with(&self, s: &GodotString) -> bool

Source

pub fn ends_with(&self, s: &GodotString) -> bool

Source

pub fn begins_with_c_str(&self, s: &CStr) -> bool

Source

pub fn sub_string(&self, range: Range<usize>) -> GodotString

Source

pub fn to_string(&self) -> String

Source

pub fn find(&self, what: &GodotString) -> i32

Source

pub fn find_from(&self, what: &GodotString, from: i32) -> i32

Source

pub fn find_last(&self, what: &GodotString) -> i32

Source

pub fn forget(self) -> godot_string

Returns the internal ffi representation of the string and consumes the rust object without running the destructor.

This should be only used when certain that the receiving side is responsible for running the destructor for the object, otherwise it is leaked.

Source

pub fn to_sys(&self) -> godot_string

Returns a copy of the internal ffi representation of the string.

The string remains owned by the rust wrapper and the receiver of the ffi representation should not run its destructor.

Source

pub fn new_ref(&self) -> GodotString

Trait Implementations§

Source§

impl Debug for GodotString

Source§

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

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

impl Default for GodotString

Source§

fn default() -> GodotString

Returns the “default value” for a type. Read more
Source§

impl Drop for GodotString

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'l> From<&'l GodotString> for Variant

Source§

fn from(val: &'l GodotString) -> Variant

Converts to this type from the input type.
Source§

impl From<GodotString> for NodePath

Source§

fn from(s: GodotString) -> NodePath

Converts to this type from the input type.
Source§

impl<S> From<S> for GodotString
where S: AsRef<str>,

Source§

fn from(s: S) -> GodotString

Converts to this type from the input type.
Source§

impl Into<GodotString> for NodePath

Source§

fn into(self) -> GodotString

Converts this type into the (usually inferred) input type.
Source§

impl PartialEq for GodotString

Source§

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

Source§

impl Eq for GodotString

Auto Trait Implementations§

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> 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, 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.