Struct apple_codesign::CodeResourcesBuilder
source · [−]pub struct CodeResourcesBuilder { /* private fields */ }
Expand description
Interface for constructing a CodeResources
instance.
This type is used during bundle signing to construct a CodeResources
instance.
It contains logic for validating a file against registered processing rules and
handling it accordingly.
Implementations
sourceimpl CodeResourcesBuilder
impl CodeResourcesBuilder
sourcepub fn default_resources_rules() -> Result<Self, AppleCodesignError>
pub fn default_resources_rules() -> Result<Self, AppleCodesignError>
Obtain an instance with default rules for a bundle with a Resources/
directory.
sourcepub fn default_no_resources_rules() -> Result<Self, AppleCodesignError>
pub fn default_no_resources_rules() -> Result<Self, AppleCodesignError>
Obtain an instance with default rules for a bundle without a Resources/
directory.
sourcepub fn add_rule(&mut self, rule: CodeResourcesRule)
pub fn add_rule(&mut self, rule: CodeResourcesRule)
Add a rule to this instance in the <rules>
section.
sourcepub fn add_rule2(&mut self, rule: CodeResourcesRule)
pub fn add_rule2(&mut self, rule: CodeResourcesRule)
Add a rule to this instance in the <rules2>
section.
sourcepub fn add_exclusion_rule(&mut self, rule: CodeResourcesRule)
pub fn add_exclusion_rule(&mut self, rule: CodeResourcesRule)
Add an exclusion rule to the processing rules.
Exclusion rules are not added to the CodeResources because they are for building only.
sourcepub fn process_file(
&mut self,
log: &Logger,
file: &DirectoryBundleFile<'_>,
file_handler: &dyn BundleFileHandler
) -> Result<(), AppleCodesignError>
pub fn process_file(
&mut self,
log: &Logger,
file: &DirectoryBundleFile<'_>,
file_handler: &dyn BundleFileHandler
) -> Result<(), AppleCodesignError>
Process a file for resource handling.
This determines whether a file is relevant for inclusion in the CodeResources file and takes actions to process it, if necessary.
sourcepub fn add_signed_macho_file(
&mut self,
path: &str,
info: &SignedMachOInfo
) -> Result<(), AppleCodesignError>
pub fn add_signed_macho_file(
&mut self,
path: &str,
info: &SignedMachOInfo
) -> Result<(), AppleCodesignError>
Add metadata for an additional signed Mach-O file.
This is likely used to register the metadata of a nested bundle. The metadata likely comes from the first Mach-O binary in the nested bundle’s main executable.
sourcepub fn write_code_resources(
&self,
writer: impl Write
) -> Result<(), AppleCodesignError>
pub fn write_code_resources(
&self,
writer: impl Write
) -> Result<(), AppleCodesignError>
Write CodeResources XML content to a writer.
Trait Implementations
sourceimpl Clone for CodeResourcesBuilder
impl Clone for CodeResourcesBuilder
sourcefn clone(&self) -> CodeResourcesBuilder
fn clone(&self) -> CodeResourcesBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CodeResourcesBuilder
impl Debug for CodeResourcesBuilder
sourceimpl Default for CodeResourcesBuilder
impl Default for CodeResourcesBuilder
sourcefn default() -> CodeResourcesBuilder
fn default() -> CodeResourcesBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for CodeResourcesBuilder
impl Send for CodeResourcesBuilder
impl Sync for CodeResourcesBuilder
impl Unpin for CodeResourcesBuilder
impl UnwindSafe for CodeResourcesBuilder
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more