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).

Implementations

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(
    &self,
    traverse_nested: bool
) -> Result<Vec<DirectoryBundleFile<'_>>>
[src]

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.