Skip to main content

TString

Struct TString 

Source
pub struct TString { /* private fields */ }

Implementations§

Source§

impl TString

Source

pub unsafe fn fix(&self)

luaS_fix

§Safety

The string must still belong to a live VM, and the caller must ensure that no concurrent or reentrant collector operation accesses its mark bits while they are updated.

Source

pub const unsafe fn from_raw(raw: NonNull<RawTString>) -> Self

Constructs a non-owning string handle from a raw VM record.

§Safety

raw must address a live RawTString owned by the VM in which the handle will be used. The handle does not root the string or extend its lifetime.

Source

pub unsafe fn from_ref(raw: &RawTString) -> Self

Constructs a non-owning string handle from a VM string record.

§Safety

raw must be a live, VM-owned string record. The returned handle may not outlive that record and does not keep it reachable from the GC.

Source

pub fn atom(&self) -> i16

Source

pub fn set_atom(&self, atom: i16)

Source

pub const fn size_string(len: usize) -> usize

Source

pub fn data_ptr(&self) -> *const u8

Source

pub unsafe fn data_mut_ptr(&self) -> *mut u8

Returns the address of the string’s inline byte storage.

§Safety

The string must be live. Mutating interned string bytes can invalidate hashes and table invariants, so writes are only valid during the VM’s owned string-construction protocol before the string is published.

Source

pub unsafe fn as_bytes(&self) -> &[u8]

Borrows the string’s bytes for the duration of this handle borrow.

§Safety

The string must remain live and its storage must not be freed for the returned borrow. Because this handle does not root the string, the caller must also prevent VM transitions that could collect it.

Source

pub unsafe fn as_bstr(&self) -> &BStr

Borrows the string’s bytes as a BStr.

§Safety

The string must remain live and its storage must not be freed for the returned borrow. Because this handle does not root the string, the caller must also prevent VM transitions that could collect it.

Trait Implementations§

Source§

impl AsRef<TString> for TString

Source§

fn as_ref(&self) -> &TString

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

impl Clone for TString

Source§

fn clone(&self) -> TString

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for TString

Source§

impl Eq for TString

Source§

impl From<TString> for GcObject

Source§

fn from(value: TString) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for TString

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl RawHandle for TString

Source§

type Raw = RawTString

Raw VM record addressed by this handle.
Source§

fn as_ptr(&self) -> *mut Self::Raw

Returns the record address without dereferencing it.
Source§

impl StructuralPartialEq for TString

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