Struct objc2_foundation::NSData
source · [−]#[repr(C)]pub struct NSData { /* private fields */ }
Expand description
Implementations
sourceimpl NSData
impl NSData
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn with_bytes(bytes: &[u8]) -> Id<Self, Shared>
pub fn from_vec(bytes: Vec<u8>) -> Id<Self, Shared>
Methods from Deref<Target = NSObject>
Methods from Deref<Target = Object>
sourcepub unsafe fn ivar<T>(&self, name: &str) -> &T where
T: Encode,
pub unsafe fn ivar<T>(&self, name: &str) -> &T where
T: Encode,
Returns a shared reference to the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
👎 Deprecated: Use Object::ivar
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
Use Object::ivar
instead.
sourcepub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut T where
T: Encode,
pub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Returns a mutable reference to the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
👎 Deprecated: Use Object::ivar_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Use Object::ivar_mut
instead.
sourcepub unsafe fn set_ivar<T>(&mut self, name: &str, value: T) where
T: Encode,
pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T) where
T: Encode,
Sets the value of the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
Trait Implementations
sourceimpl AsMut<NSData> for NSMutableData
impl AsMut<NSData> for NSMutableData
sourceimpl AsRef<NSData> for NSMutableData
impl AsRef<NSData> for NSMutableData
sourceimpl Borrow<NSData> for NSMutableData
impl Borrow<NSData> for NSMutableData
sourceimpl BorrowMut<NSData> for NSMutableData
impl BorrowMut<NSData> for NSMutableData
sourcefn borrow_mut(&mut self) -> &mut NSData
fn borrow_mut(&mut self) -> &mut NSData
Mutably borrows from an owned value. Read more
sourceimpl BorrowMut<NSObject> for NSData
impl BorrowMut<NSObject> for NSData
sourcefn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
sourceimpl BorrowMut<Object> for NSData
impl BorrowMut<Object> for NSData
sourcefn borrow_mut(&mut self) -> &mut Object
fn borrow_mut(&mut self) -> &mut Object
Mutably borrows from an owned value. Read more
sourceimpl NSMutableCopying for NSData
impl NSMutableCopying for NSData
type Output = NSMutableData
type Output = NSMutableData
TODO
fn mutable_copy(&self) -> Id<Self::Output, Owned>
sourceimpl RefEncode for NSData
impl RefEncode for NSData
sourceconst ENCODING_REF: Encoding<'static> = ::objc2::Encoding::Object
const ENCODING_REF: Encoding<'static> = ::objc2::Encoding::Object
The Objective-C type-encoding for a reference of this type. Read more
sourceimpl ToOwned for NSData
impl ToOwned for NSData
impl Eq for NSData
impl Message for NSData
impl Send for NSData
impl Sync for NSData
Auto Trait Implementations
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