pub struct Data(/* private fields */);Implementations§
Source§impl Data
impl Data
pub fn with_contents_of_file<'ear, P: AsRef<String>>( path: P, options: ReadOpts, ) -> Result<R<Self>, &'ear Error>
pub fn with_contents_of_url<'ear, U: AsRef<Url>>( url: U, options: ReadOpts, ) -> Result<R<Self>, &'ear Error>
pub fn with_bytes(bytes: &[u8]) -> R<Self>
pub fn bytes(&self) -> *const u8
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn get_bytes(&self, buffer: *mut u8, length: usize)
pub fn get_bytes_range(&self, buffer: *mut u8, range: Range)
Sourcepub fn write_to_file(&self, path: &String, atomically: bool) -> bool
pub fn write_to_file(&self, path: &String, atomically: bool) -> bool
Writes the contents of the receiver to the file specified by a given path.
Writes the contents of the receiver to the file specified by path (overwriting any existing file at path). path is written in the default C-string encoding if possible (that is, if no information would be lost), in the Unicode encoding otherwise.
If flag is YES, the receiver is written to an auxiliary file, and then the auxiliary file is renamed to path. If flag is NO, the receiver is written directly to path. The YES option guarantees that path, if it exists at all, won’t be corrupted even if the system should crash during writing.
If path contains a tilde (~) character, you must expand it with stringByExpandingTildeInPath before invoking this method.
pub fn write_at_path(&self, path: &String, atomically: bool) -> Result<(), ()>
pub fn as_cf(&self) -> &Data
Methods from Deref<Target = Id>§
pub unsafe fn value_for_key_throws_ar(&self, key: &String) -> Option<Rar<Self>>
pub unsafe fn value_for_key_throws(&self, key: &String) -> Option<R<Self>>
pub fn value_for_key<'ear>( &self, key: &String, ) -> ExResult<'ear, Option<R<Self>>>
pub unsafe fn set_value_for_key_throws( &mut self, val: Option<&Self>, key: &String, )
pub fn set_value_for_key<'ear>( &mut self, val: Option<&Self>, key: &String, ) -> ExResult<'ear>
pub unsafe fn value_for_key_path_throws_ar( &self, key_path: &String, ) -> Option<Rar<Self>>
pub unsafe fn value_for_key_path_throws( &self, key_path: &String, ) -> Option<R<Self>>
pub fn value_for_key_path<'ear>( &self, key_path: &String, ) -> ExResult<'ear, Option<R<Self>>>
pub unsafe fn set_value_for_key_path_throws( &mut self, val: Option<&Self>, key_path: &String, )
pub fn set_value_for_key_path<'ear>( &mut self, val: Option<&Self>, key_path: &String, ) -> ExResult<'ear>
pub fn as_type_ref(&self) -> &Type
pub fn as_id_ref(&self) -> &Self
pub fn is_equal(&self, other: &Self) -> bool
pub fn hash(&self) -> UInteger
pub fn as_ptr(&self) -> *const Self
Trait Implementations§
Source§impl Obj for Data
impl Obj for Data
unsafe fn retain(id: &Self) -> R<Self>
unsafe fn release(id: &mut Self)
fn desc_ar(&self) -> Rar<String>
fn desc(&self) -> R<String>
fn debug_desc_ar(&self) -> Rar<String>
fn debug_desc(&self) -> R<String>
fn responds_to_sel(&self, sel: &Sel) -> bool
fn class(&self) -> &Class<Self>
fn is_kind_of_class<T: Obj>(&self, cls: &Class<T>) -> bool
fn try_cast<T: Obj>(&self, cls: &Class<T>) -> Option<&T>
fn try_cast_mut<T: Obj>(&mut self, cls: &Class<T>) -> Option<&mut T>
fn is_member_of_class<T: Obj>(&self, cls: &Class<T>) -> bool
fn is_tagged_ptr(&self) -> bool
fn as_id_ref(&self) -> &Id
impl Send for Data
impl StructuralPartialEq for Data
Auto Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more