Skip to main content

OptimizeSvg

Struct OptimizeSvg 

Source
pub struct OptimizeSvg;
Expand description

SVG optimization processor — removes editor metadata, comments, unused namespaces, empty containers, and collapses redundant groups.

Trait Implementations§

Source§

impl NodeProcessor for OptimizeSvg

Source§

fn name(&self) -> &str

The processor’s type key (e.g., “image-compress”). Must match the key used in registry.register(). Convention: category-operation, kebab-case.
Source§

fn metadata(&self) -> NodeMetadata

Return the processor’s self-describing metadata. Read more
Source§

fn process( &self, input: NodeInput, progress: &ProgressReporter, _ctx: &dyn ProcessContext, ) -> Result<NodeOutput, BntoError>

Process a single input file and produce output. Read more
Source§

fn validate(&self, params: &Map<String, Value>) -> Vec<String>

Validate the input parameters before processing. Read more
Source§

fn reserved_tokens(&self) -> &'static [&'static str]

Tokens this processor fills in its params itself, after the executor (shell-run’s {{output_dir}}, {{url}}, each groups’ {{path}}). A value the executor fills in may not carry one: the processor couldn’t tell it from the recipe’s own. An entry ending in . ({{item.) covers every token it starts. Read more
Source§

fn validate_raw(&self, _raw: &Map<String, Value>) -> Vec<String>

Problems in the params as the recipe wrote them, before any template is filled — what validate can’t see once data is in, such as a data placeholder in a param that must be literal. The executor refuses the run on any, before a step starts; bnto check reports them. Read more
Source§

fn platform_problems( &self, _params: &Map<String, Value>, _platforms: &[&str], ) -> Vec<String>

Problems the params cause on some of the platforms the step can run on: the values {{ctx.platform}} may read there (macos, linux, windows, unknown), narrowed by the platform guards on its path. bnto check reports them (shell-run’s Windows-only powershell). Read more
Source§

fn count_keys(&self) -> &'static [&'static str]

Keys of the node-level NodeOutput.metadata that count something per call (e.g. files copied). When the node runs more than once — a per-file node over several files, a loop’s iterations — the executor adds these up in the node’s record instead of keeping the last call’s value. Read more
Source§

fn resolves_items(&self) -> bool

True for a batch node that fills {{item.*}} in its params itself, once per incoming file (assert, report). Outside a loop there is no item to resolve them against once, so the executor hands them to the node as written instead of refusing them. Read more
Source§

fn process_batch( &self, input: BatchInput, progress: &ProgressReporter, ctx: &dyn ProcessContext, ) -> Result<NodeOutput, BntoError>

Process a batch of files together, producing combined output. Read more
Source§

fn declared_params(&self) -> Option<Vec<ParameterDef>>

The params a run accepts for this node: its metadata’s, or None when the processor keeps the placeholder metadata() above (test mocks), which declares nothing. A run refuses any other param.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.