Struct libil2cpp::Il2CppString
source · [−]#[repr(transparent)]pub struct Il2CppString(_);
Expand description
An il2cpp string
Implementations
sourceimpl Il2CppString
impl Il2CppString
sourcepub fn new(s: impl AsRef<str>) -> &'static mut Self
pub fn new(s: impl AsRef<str>) -> &'static mut Self
Creates a new string from a Rust string
sourcepub fn to_string(&self) -> Result<String, FromUtf16Error>
pub fn to_string(&self) -> Result<String, FromUtf16Error>
Converts the string to a Rust string, returning an error if its utf-16 data is invalid
sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Converts the string to a Rust string, replacing any of its invalid data
with the replacement character
(U+FFFD
)
sourcepub fn as_utf16_mut(&mut self) -> &mut [u16]
pub fn as_utf16_mut(&mut self) -> &mut [u16]
Returns the string’s utf-16 data as a mutable slice
Methods from Deref<Target = Il2CppObject>
sourcepub fn class(&self) -> &'static Il2CppClass
pub fn class(&self) -> &'static Il2CppClass
Il2CppClass
of the object
sourcepub fn invoke<A, R, const N: usize>(
&mut self,
name: &str,
args: A
) -> Result<R, &mut Il2CppException> where
A: Arguments<N>,
R: Returned,
pub fn invoke<A, R, const N: usize>(
&mut self,
name: &str,
args: A
) -> Result<R, &mut Il2CppException> where
A: Arguments<N>,
R: Returned,
Invokes the method with the given name on self
using the given
arguments, with type checking
Panics
This method will panic if a matching method can’t be found.
sourcepub fn invoke_void<A, const N: usize>(
&mut self,
name: &str,
args: A
) -> Result<(), &mut Il2CppException> where
A: Arguments<N>,
pub fn invoke_void<A, const N: usize>(
&mut self,
name: &str,
args: A
) -> Result<(), &mut Il2CppException> where
A: Arguments<N>,
Invokes the void
method with the given name on self
using the
given arguments, with type checking
Panics
This method will panic if a matching method can’t be found.
Trait Implementations
sourceimpl AsMut<[u16]> for Il2CppString
impl AsMut<[u16]> for Il2CppString
sourceimpl AsRef<[u16]> for Il2CppString
impl AsRef<[u16]> for Il2CppString
sourceimpl Debug for Il2CppString
impl Debug for Il2CppString
sourceimpl Deref for Il2CppString
impl Deref for Il2CppString
type Target = Il2CppObject
type Target = Il2CppObject
The resulting type after dereferencing.
sourceimpl DerefMut for Il2CppString
impl DerefMut for Il2CppString
sourceimpl<'de> Deserialize<'de> for &mut Il2CppString
impl<'de> Deserialize<'de> for &mut Il2CppString
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for Il2CppString
impl Display for Il2CppString
sourceimpl<T> From<T> for &'static mut Il2CppString where
T: AsRef<str>,
impl<T> From<T> for &'static mut Il2CppString where
T: AsRef<str>,
sourceimpl FromStr for &'static mut Il2CppString
impl FromStr for &'static mut Il2CppString
sourceimpl<T> PartialEq<T> for Il2CppString where
T: AsRef<str>,
impl<T> PartialEq<T> for Il2CppString where
T: AsRef<str>,
sourceimpl Serialize for Il2CppString
impl Serialize for Il2CppString
sourceimpl TryFrom<&Il2CppString> for String
impl TryFrom<&Il2CppString> for String
type Error = FromUtf16Error
type Error = FromUtf16Error
The type returned in the event of a conversion error.
sourcefn try_from(value: &Il2CppString) -> Result<Self, Self::Error>
fn try_from(value: &Il2CppString) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl Type for Il2CppString
impl Type for Il2CppString
type Held<'a> = Option<&'a mut Il2CppString>
type Held<'a> = Option<&'a mut Il2CppString>
Type of the values held in variables of the type
type HeldRaw = *mut Il2CppString
type HeldRaw = *mut Il2CppString
Non-generic version of [Held
].
sourceconst CLASS_NAME: &'static str = "String"
const CLASS_NAME: &'static str = "String"
Name of the class the type represents
sourcefn matches_reference_argument(ty: &Il2CppType) -> bool
fn matches_reference_argument(ty: &Il2CppType) -> bool
Whether a reference to the type can be used as an argument of the given
Il2CppType
Read more
sourcefn matches_value_argument(_: &Il2CppType) -> bool
fn matches_value_argument(_: &Il2CppType) -> bool
Whether a value of the type can be used as an argument of the given
Il2CppType
Read more
sourcefn matches_reference_parameter(ty: &Il2CppType) -> bool
fn matches_reference_parameter(ty: &Il2CppType) -> bool
Whether a reference to the type can be used as a parameter of the given
Il2CppType
Read more
sourcefn matches_value_parameter(_: &Il2CppType) -> bool
fn matches_value_parameter(_: &Il2CppType) -> bool
Whether a value of the type can be used as a parameter of the given
Il2CppType
Read more
sourcefn class() -> &'static Il2CppClass
fn class() -> &'static Il2CppClass
Il2CppClass
of the type
sourcefn matches_this_argument(method: &MethodInfo) -> bool
fn matches_this_argument(method: &MethodInfo) -> bool
Whether the type can be used as a this
argument for the given
MethodInfo
Read more
sourcefn matches_this_parameter(method: &MethodInfo) -> bool
fn matches_this_parameter(method: &MethodInfo) -> bool
Whether the type can be used as a this
parameter for the given
MethodInfo
Read more
sourcefn matches_returned(ty: &Il2CppType) -> bool
fn matches_returned(ty: &Il2CppType) -> bool
Whether the type can be used as the value of the given Il2CppType
returned from a C# method Read more
sourcefn matches_return(ty: &Il2CppType) -> bool
fn matches_return(ty: &Il2CppType) -> bool
Whether the type can be used as the return value of the given
Il2CppType
for a C# method Read more
sourceimpl WrapRaw for Il2CppString
impl WrapRaw for Il2CppString
type Raw = Il2CppString
type Raw = Il2CppString
Raw il2cpp type
sourceunsafe fn raw_mut(&mut self) -> &mut Self::Raw
unsafe fn raw_mut(&mut self) -> &mut Self::Raw
Returns a mutable reference to the underlying raw il2cpp type Read more
sourceunsafe fn wrap_mut(raw: &mut Self::Raw) -> &mut Self
unsafe fn wrap_mut(raw: &mut Self::Raw) -> &mut Self
Wraps a mutable reference to the raw il2cpp type Read more
Auto Trait Implementations
impl RefUnwindSafe for Il2CppString
impl !Send for Il2CppString
impl !Sync for Il2CppString
impl Unpin for Il2CppString
impl UnwindSafe for Il2CppString
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more