[][src]Struct thrift_compiler::Config

pub struct Config { /* fields omitted */ }

Builder for thrift compilare wrapper

Implementations

impl Config[src]

pub fn new(thrift_bin: OsString, out_dir: PathBuf) -> Self[src]

Return a new configuration with the required parameters set

pub fn from_env() -> Result<Self>[src]

Return a new configuration with parameters computed based on environment variables set by Cargo's build scrip (OUT_DIR mostly). It requires that either "thrift1" is an executable callable by Command (e.g. on unix it means that it is in the PATH) or that the THRIFT environment variable points to a thrift executable

pub fn base_path(&mut self, value: impl Into<PathBuf>) -> &mut Self[src]

Set the base path which is used by the compiler to find thrift files included by input thrift files

pub fn crate_map(&mut self, value: impl Into<PathBuf>) -> &mut Self[src]

Set the path to file with crate map definition which is used by the compiler to infer crate names that will be used in the generated code. Please refer to code in fbthrift/thrift/compiler/generate/t_mstch_rust_generator.cc for the scheme of crate map.

pub fn options(&mut self, value: impl Into<String>) -> &mut Self[src]

Set the options to be passed to mstch_rust code generation. Example options are serde.

pub fn run(
    &self,
    input_files: impl IntoIterator<Item = impl AsRef<Path>>
) -> Result<()>
[src]

Run the compiler on the input files. As a result a lib.rs file will be generated inside the output dir.

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.