Struct safer_ffi::headers::Builder [−][src]
pub struct Builder<'__, W> { /* fields omitted */ }
This is supported on crate feature
headers
only.Implementations
impl<'__, W> Builder<'__, W>
[src]
impl<'__, W> Builder<'__, W>
[src]pub fn with_guard(self, guard: &'__ str) -> Self
[src]
pub fn with_guard(self, guard: &'__ str) -> Self
[src]Sets up the name of the ifndef
guard of the header file.
It defaults to:
ⓘ
format!("__RUST_{}__", env::var("CARGO_PKG_NAME")?.to_ascii_uppercase())
pub fn with_banner(self, banner: &'__ str) -> Self
[src]
pub fn with_banner(self, banner: &'__ str) -> Self
[src]Sets up the banner of the generated C header file.
It defaults to:
ⓘ
concat!( "/*! \\file */\n", "/*******************************************\n", " * *\n", " * File auto-generated by `::safer_ffi`. *\n", " * *\n", " * Do not manually edit this file. *\n", " * *\n", " *******************************************/\n", )
/*! \file */ /******************************************* * * * File auto-generated by `::safer_ffi`. * * * * Do not manually edit this file. * * * *******************************************/
impl<'__> Builder<'__, WhereTo>
[src]
impl<'__> Builder<'__, WhereTo>
[src]pub fn to_file(self, filename: impl AsRef<Path>) -> Result<Builder<'__, File>>
[src]
pub fn to_file(self, filename: impl AsRef<Path>) -> Result<Builder<'__, File>>
[src]Specify the path to the file to be generated.
⚠️ If it already exists, its contents will be overwritten ⚠️
There is no default value here, either .to_file()
or .to_writer()
need to be called to be able to .generate()
the headers.
For more fine-grained control over the “output stream” where the
headers will be written to, use .to_writer()
.
Example
::safer_ffi::headers::builder() .to_file("my_header.h")? .generate()?
impl Builder<'_, WhereTo>
[src]
impl Builder<'_, WhereTo>
[src]pub fn generate_with_definer(self, definer: impl Definer) -> Result<()>
[src]
pub fn generate_with_definer(self, definer: impl Definer) -> Result<()>
[src]More customizable version of .generate()
.
With this call, one can provide a custom implementation of a Definer
,
which can be useful for mock tests, mainly.
Trait Implementations
Auto Trait Implementations
impl<'__, W> RefUnwindSafe for Builder<'__, W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<'__, W> Send for Builder<'__, W> where
W: Send,
W: Send,
impl<'__, W> Sync for Builder<'__, W> where
W: Sync,
W: Sync,
impl<'__, W> Unpin for Builder<'__, W> where
W: Unpin,
W: Unpin,
impl<'__, W> UnwindSafe for Builder<'__, W> where
W: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ManuallyDropMut for T
[src]
impl<T> ManuallyDropMut for T
[src]