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: PathBufSpecify input directory to generate wit definitions from
Will expect library: <input-dir>/src/lib.rs
output: PathBufSpecify 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: boolPrint results to stdout instead file
skip_resolve: boolDo not resolve the use references in generated wit file to combine into one
skip_prologue: boolSkip adding prologue to file
cargo: ClapCargoImplementations§
Source§impl 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§
Source§impl FromArgMatches for Witgen
impl FromArgMatches for Witgen
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn 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>
Source§fn 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.Source§fn 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 Freeze for Witgen
impl RefUnwindSafe for Witgen
impl Send for Witgen
impl Sync for Witgen
impl Unpin for Witgen
impl UnwindSafe for Witgen
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more