[−][src]Struct safer_ffi::headers::Builder
This is supported on
feature="headers"
only.Implementations
impl<'__, W> Builder<'__, W>
[src]
pub fn with_guard(self, guard: &'__ str) -> Self
[src]
This is supported on
feature="headers"
only.Sets up the name of the ifndef
guard of the header file.
It defaults to:
ⓘThis example is not tested
format!("__RUST_{}__", env::var("CARGO_PKG_NAME")?.to_ascii_uppercase())
pub fn with_banner(self, banner: &'__ str) -> Self
[src]
This is supported on
feature="headers"
only.Sets up the banner of the generated C header file.
It defaults to:
ⓘThis example is not tested
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]
pub fn to_file(self, filename: impl AsRef<Path>) -> Result<Builder<'__, File>>
[src]
This is supported on
feature="headers"
only.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()?
pub fn to_writer<W>(self, out: W) -> Builder<'__, W> where
W: Write,
[src]
W: Write,
This is supported on
feature="headers"
only.impl<'__, W: Write> Builder<'__, W>
[src]
pub fn generate(self) -> Result<()>
[src]
This is supported on
feature="headers"
only.Generate the C header file.
impl<'_> Builder<'_, WhereTo>
[src]
pub fn generate_with_definer(self, definer: impl Definer) -> Result<()>
[src]
This is supported on
feature="headers"
only.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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ManuallyDropMut for T
type Ret = ManuallyDrop<T>
fn manually_drop_mut(&'__ mut self) -> &'__ mut ManuallyDrop<T>
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,