Skip to main content

ValueRef

Struct ValueRef 

Source
pub struct ValueRef<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ValueRef<'a>

Source

pub unsafe fn from_ptr(value: *const ScsValue) -> Option<Self>

Borrows a tagged SDK value for the duration of its callback.

§Safety

value must either be null or point to a correctly aligned, initialized sys::ScsValue that remains alive for 'a. For a known type tag, the corresponding union member must be initialized. Unknown tags are preserved without reading the union. String members must be non-null, NUL-terminated, and remain alive for the same lifetime.

Source

pub const fn raw_type(self) -> ScsValueType

Source

pub const fn value_type(self) -> Option<ValueType>

Source

pub fn as_bool(self) -> Option<bool>

Source

pub fn as_i32(self) -> Option<i32>

Source

pub fn as_u32(self) -> Option<u32>

Source

pub fn as_u64(self) -> Option<u64>

Source

pub fn as_i64(self) -> Option<i64>

Source

pub fn as_f32(self) -> Option<f32>

Source

pub fn as_f64(self) -> Option<f64>

Source

pub fn as_fvector(self) -> Option<FVector>

Source

pub fn as_dvector(self) -> Option<DVector>

Source

pub fn as_euler(self) -> Option<Euler>

Source

pub fn as_fplacement(self) -> Option<FPlacement>

Source

pub fn as_dplacement(self) -> Option<DPlacement>

Source

pub fn as_c_str(self) -> Option<&'a CStr>

Trait Implementations§

Source§

impl<'a> Clone for ValueRef<'a>

Source§

fn clone(&self) -> ValueRef<'a>

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<'a> Copy for ValueRef<'a>

Auto Trait Implementations§

§

impl<'a> !Send for ValueRef<'a>

§

impl<'a> !Sync for ValueRef<'a>

§

impl<'a> Freeze for ValueRef<'a>

§

impl<'a> RefUnwindSafe for ValueRef<'a>

§

impl<'a> Unpin for ValueRef<'a>

§

impl<'a> UnsafeUnpin for ValueRef<'a>

§

impl<'a> UnwindSafe for ValueRef<'a>

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