Skip to main content

Bundle

Struct Bundle 

Source
pub struct Bundle(/* private fields */);
Expand description

An Objective-C bundle object.

C++ equivalent: NS::Bundle

Implementations§

Source§

impl Bundle

Source

pub fn main_bundle() -> Option<Self>

Get the main bundle.

C++ equivalent: static Bundle* mainBundle()

Source

pub fn bundle_with_path(path: &String) -> Option<Self>

Get a bundle with the specified path.

C++ equivalent: static Bundle* bundle(const class String* pPath)

Source

pub fn bundle_with_url(url: &Url) -> Option<Self>

Get a bundle with the specified URL.

C++ equivalent: static Bundle* bundle(const class URL* pURL)

Source

pub fn all_bundles() -> *mut Array<Bundle>

Get all bundles.

C++ equivalent: static class Array* allBundles()

Source

pub fn all_frameworks() -> *mut Array<Bundle>

Get all frameworks.

C++ equivalent: static class Array* allFrameworks()

Source

pub fn alloc() -> Option<Self>

Allocate a new bundle.

C++ equivalent: static Bundle* alloc()

Source

pub fn init_with_path(&self, path: &String) -> Option<Self>

Initialize with a path.

C++ equivalent: Bundle* init(const class String* pPath)

Source

pub fn init_with_url(&self, url: &Url) -> Option<Self>

Initialize with a URL.

C++ equivalent: Bundle* init(const class URL* pURL)

Source

pub fn load(&self) -> bool

Load the bundle.

C++ equivalent: bool load()

Source

pub fn unload(&self) -> bool

Unload the bundle.

C++ equivalent: bool unload()

Source

pub fn is_loaded(&self) -> bool

Check if the bundle is loaded.

C++ equivalent: bool isLoaded() const

Source

pub fn preflight_and_return_error(&self, error: *mut *mut Error) -> bool

Preflight the bundle and return any error.

C++ equivalent: bool preflightAndReturnError(class Error** pError) const

Source

pub fn load_and_return_error(&self, error: *mut *mut Error) -> bool

Load the bundle and return any error.

C++ equivalent: bool loadAndReturnError(class Error** pError)

Source

pub fn bundle_url(&self) -> *mut Url

Get the bundle URL.

C++ equivalent: class URL* bundleURL() const

Source

pub fn resource_url(&self) -> *mut Url

Get the resource URL.

C++ equivalent: class URL* resourceURL() const

Source

pub fn executable_url(&self) -> *mut Url

Get the executable URL.

C++ equivalent: class URL* executableURL() const

Source

pub fn url_for_auxiliary_executable(&self, name: &String) -> *mut Url

Get the URL for an auxiliary executable.

C++ equivalent: class URL* URLForAuxiliaryExecutable(const class String* pExecutableName) const

Source

pub fn private_frameworks_url(&self) -> *mut Url

Get the private frameworks URL.

Source

pub fn shared_frameworks_url(&self) -> *mut Url

Get the shared frameworks URL.

Source

pub fn shared_support_url(&self) -> *mut Url

Get the shared support URL.

Source

pub fn built_in_plug_ins_url(&self) -> *mut Url

Get the built-in plug-ins URL.

Source

pub fn app_store_receipt_url(&self) -> *mut Url

Get the App Store receipt URL.

Source

pub fn bundle_path(&self) -> *mut String

Get the bundle path.

C++ equivalent: class String* bundlePath() const

Source

pub fn resource_path(&self) -> *mut String

Get the resource path.

Source

pub fn executable_path(&self) -> *mut String

Get the executable path.

Source

pub fn path_for_auxiliary_executable(&self, name: &String) -> *mut String

Get the path for an auxiliary executable.

Source

pub fn private_frameworks_path(&self) -> *mut String

Get the private frameworks path.

Source

pub fn shared_frameworks_path(&self) -> *mut String

Get the shared frameworks path.

Source

pub fn shared_support_path(&self) -> *mut String

Get the shared support path.

Source

pub fn built_in_plug_ins_path(&self) -> *mut String

Get the built-in plug-ins path.

Source

pub fn bundle_identifier(&self) -> *mut String

Get the bundle identifier.

C++ equivalent: class String* bundleIdentifier() const

Source

pub fn info_dictionary(&self) -> *mut Dictionary

Get the info dictionary.

C++ equivalent: class Dictionary* infoDictionary() const

Source

pub fn localized_info_dictionary(&self) -> *mut Dictionary

Get the localized info dictionary.

C++ equivalent: class Dictionary* localizedInfoDictionary() const

Source

pub fn object_for_info_dictionary_key(&self, key: &String) -> *mut Object

Get an object from the info dictionary.

C++ equivalent: class Object* objectForInfoDictionaryKey(const class String* pKey)

Source

pub fn localized_string( &self, key: &String, value: *const String, table_name: *const String, ) -> *mut String

Get a localized string.

C++ equivalent: class String* localizedString(const class String* pKey, const class String* pValue = nullptr, const class String* pTableName = nullptr) const

Source

pub unsafe fn from_ptr(ptr: *mut c_void) -> Option<Self>

Create a Bundle from a raw pointer.

§Safety

The pointer must be a valid Objective-C NSBundle object.

Trait Implementations§

Source§

impl Clone for Bundle

Source§

fn clone(&self) -> Bundle

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Bundle

Source§

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

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

impl Referencing for Bundle

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> UInteger

Get the retain count of the object. Read more
Source§

impl Send for Bundle

Source§

impl Sync for Bundle

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.