Struct tugger_apple_bundle::DirectoryBundle[][src]

pub struct DirectoryBundle { /* fields omitted */ }

An Apple bundle backed by a filesystem/directory.

Instances represent a type-agnostic bundle (macOS application bundle, iOS application bundle, framework bundles, etc).


impl DirectoryBundle[src]

pub fn new_from_path(directory: &Path) -> Result<Self>[src]

Open an existing bundle from a filesystem path.

The specified path should be the root directory of the bundle.

This will validate that the directory is a bundle and error if not. Validation is limited to locating an Info.plist file, which is required for all bundle types.

pub fn resolve_path(&self, path: impl AsRef<Path>) -> PathBuf[src]

Resolve the absolute path to a file in the bundle.

pub fn root_dir(&self) -> &Path[src]

The root directory of this bundle.

pub fn name(&self) -> &str[src]

The on-disk name of this bundle.

This is effectively the directory name of the bundle. Contains the .app, .framework, etc suffix.

pub fn shallow(&self) -> bool[src]

Whether this is a shallow bundle.

If false, content is likely in a Contents directory.

pub fn info_plist_path(&self) -> PathBuf[src]

Obtain the path to the Info.plist file.

pub fn info_plist(&self) -> &Dictionary[src]

Obtain the parsed Info.plist file.

pub fn info_plist_key_string(&self, key: &str) -> Result<Option<String>>[src]

Obtain an Info.plist key as a String.

Will return None if the specified key doesn’t exist. Errors if the key value is not a string.

pub fn package_type(&self) -> BundlePackageType[src]

Obtain the type of bundle.

pub fn display_name(&self) -> Result<Option<String>>[src]

Obtain the bundle display name.

This retrieves the value of CFBundleDisplayName from the Info.plist.

pub fn identifier(&self) -> Result<Option<String>>[src]

Obtain the bundle identifier.

This retrieves CFBundleIdentifier from the Info.plist.

pub fn version(&self) -> Result<Option<String>>[src]

Obtain the bundle version string.

This retrieves CFBundleVersion from the Info.plist.

pub fn main_executable(&self) -> Result<Option<String>>[src]

Obtain the name of the bundle’s main executable file.

This retrieves CFBundleExecutable from the Info.plist.

pub fn icon_files(&self) -> Result<Option<Vec<String>>>[src]

Obtain filenames of bundle icon files.

This retrieves CFBundleIconFiles from the Info.plist.

pub fn files(
    traverse_nested: bool
) -> Result<Vec<DirectoryBundleFile<'_>>>

Obtain all files within this bundle.

The iteration order is deterministic.

traverse_nested defines whether to traverse into nested bundles.

pub fn nested_bundles(&self) -> Result<Vec<(String, Self)>>[src]

Obtain all nested bundles within this one.

This walks the directory tree for directories that can be parsed as bundles.

This will descend infinitely into nested bundles. i.e. we don’t stop traversing directories when we encounter a bundle.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.