Skip to main content

Merger

Struct Merger 

Source
pub struct Merger { /* private fields */ }
Expand description

A builder for combining winmd files.

Implementations§

Source§

impl Merger

Source

pub fn new() -> Self

Creates an empty merge configuration.

Source

pub fn input(&mut self, input: impl AsRef<Path>) -> &mut Self

Adds an input winmd file.

Source

pub fn inputs<I, S>(&mut self, inputs: I) -> &mut Self
where I: IntoIterator<Item = S>, S: AsRef<Path>,

Adds input winmd files.

Source

pub fn arch_input(&mut self, path: impl AsRef<Path>, arch: i32) -> &mut Self

Adds an architecture-tagged input winmd file.

Source

pub fn union_enums(&mut self) -> &mut Self

Unions same-named enums across inputs into a single enum, deduplicating members.

Without this, two inputs that each define an enum with the same namespace and name produce two TypeDef rows. tool_win32 uses this to reconcile a value type an um header truncates (for example FILE_INFORMATION_CLASS) with the complete km definition, yielding one enum carrying every member.

Source

pub fn output(&mut self, output: impl AsRef<Path>) -> &mut Self

Sets the output winmd path.

Source

pub fn merge(&self) -> Result<(), Error>

Combines the configured inputs and writes the output winmd.

Returns an error when the output is missing, an input cannot be read, or the metadata cannot be merged.

Trait Implementations§

Source§

impl Default for Merger

Source§

fn default() -> Merger

Returns the “default value” for a type. Read more

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.