Skip to main content

Data

Struct Data 

Source
pub struct Data(/* private fields */);

Implementations§

Source§

impl Data

Source

pub fn retained(&self) -> R<Self>

Source§

impl Data

Source

pub fn type_id() -> TypeId

Source

pub fn new_in( bytes: *const u8, length: Index, allocator: Option<&Allocator>, ) -> Option<R<Data>>

Source

pub fn new(bytes: *const u8, length: Index) -> Option<R<Data>>

Source

pub fn from_slice(slice: &[u8]) -> Option<R<Self>>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn copy_mut_in( &self, capacity: Index, allocator: Option<&Allocator>, ) -> Option<R<DataMut>>

Source

pub fn copy_mut(&self, capacity: usize) -> R<DataMut>

Source

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

Source

pub fn copy_bytes(&self, buffer: &mut [u8])

Source

pub unsafe fn get_bytes(&self, range: Range, buffer: *mut u8)

Source

pub fn as_slice(&self) -> &[u8]

Source

pub fn as_ns(&self) -> &Data

Methods from Deref<Target = Type>§

Source

pub fn get_type_id(&self) -> TypeId

Source

pub unsafe fn as_type_ptr(&self) -> *const c_void

Source

pub fn as_type_ref(&self) -> &Type

Source

pub fn is_tagged_ptr(&self) -> bool

Source

pub fn try_as_number(&self) -> Option<&Number>

Source

pub fn try_as_string(&self) -> Option<&String>

Source

pub fn show(&self)

Source

pub fn allocator(&self) -> Option<&Allocator>

Source

pub fn retain_count(&self) -> isize

Source

pub fn equal(&self, other: &Type) -> bool

use cidre::cf;

let n1 = cf::Number::from_i8(4);
let n2 = cf::Number::from_i32(4);
let n3 = cf::Number::from_f64(3.0);

assert!(n1.equal(&n2));
assert_eq!(false, n1.equal(&n3));
Source

pub fn hash(&self) -> usize

Source

pub fn desc(&self) -> R<String>

Trait Implementations§

Source§

impl AsRef<Data> for Data

Source§

fn as_ref(&self) -> &Data

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

impl AsRef<Type> for Data

Source§

fn as_ref(&self) -> &Type

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

impl Debug for Data

Source§

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

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

impl Deref for Data

Source§

type Target = Type

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for Data

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<&Data> for &Plist

Source§

fn from(value: &Data) -> Self

Converts to this type from the input type.
Source§

impl Release for Data

Source§

unsafe fn release(&mut self)

Source§

impl Retain for Data

Source§

fn retained(&self) -> R<Self>

Auto Trait Implementations§

§

impl !Send for Data

§

impl !Sync for Data

§

impl Freeze for Data

§

impl RefUnwindSafe for Data

§

impl Unpin for Data

§

impl UnsafeUnpin for Data

§

impl UnwindSafe for Data

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.