Struct cargo_witgen::Witgen
source · [−]pub struct Witgen {
pub input: Option<PathBuf>,
pub input_dir: PathBuf,
pub output: PathBuf,
pub prefix_file: Vec<PathBuf>,
pub prefix_string: Vec<String>,
pub stdout: bool,
pub skip_resolve: bool,
pub skip_prologue: bool,
pub cargo: ClapCargo,
}
Fields
input: Option<PathBuf>
Specify input file to generate wit definitions from
input_dir: PathBuf
Specify input directory to generate wit definitions from
Will expect library: <input-dir>/src/lib.rs
output: PathBuf
Specify output file to generate wit definitions
prefix_file: Vec<PathBuf>
Specify prefix file to copy into top of the generated wit file
prefix_string: Vec<String>
Specify prefix string to copy into top of the generated wit file
--prefix-string 'use * from "string.wit"'
stdout: bool
Print results to stdout instead file
skip_resolve: bool
Do not resolve the use
references in generated wit file to combine into one
skip_prologue: bool
Skip adding prologue to file
cargo: ClapCargo
Implementations
sourceimpl Witgen
impl Witgen
pub fn from_path(path: &Path) -> Self
pub fn gen_from_path(path: &Path) -> Result<String>
pub fn gen_static_from_path(path: &Path) -> Result<String>
pub fn read_input(&self) -> Result<File>
pub fn generate_str(&self, file: File) -> Result<String>
pub fn write_output(&self, wit_str: &str) -> Result<()>
pub fn resolve_wit(&self, wit_str: &str) -> Result<HashMap<String, String>>
pub fn run(&self) -> Result<()>
pub fn resolve(&self, wit_str: &str) -> Result<String>
Trait Implementations
sourceimpl FromArgMatches for Witgen
impl FromArgMatches for Witgen
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
sourcefn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
sourcefn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches
to self
.
sourcefn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches
to self
.
Auto Trait Implementations
impl RefUnwindSafe for Witgen
impl Send for Witgen
impl Sync for Witgen
impl Unpin for Witgen
impl UnwindSafe for Witgen
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