pub struct Cbindgen { /* private fields */ }Expand description
C / cbindgen language adapter. Build it with CbindgenBuilder::new, declare the
items to convert with the fluent methods, then drive it through
CbindgenBuilder::build → Cbindgen::write_rust.
A resolved C binding: every crossing has a conversion, and the header-facing Rust file can be written.
Built by CbindgenBuilder::build. Read-only, so write_rust is a pure
emission over a complete registry.
Implementations§
Source§impl Cbindgen
impl Cbindgen
Sourcepub fn builder() -> CbindgenBuilder
pub fn builder() -> CbindgenBuilder
Describe a C binding.
Sourcepub fn write_rust(
&self,
out_path: impl AsRef<Path>,
) -> Result<PathBuf, WriteRustError>
pub fn write_rust( &self, out_path: impl AsRef<Path>, ) -> Result<PathBuf, WriteRustError>
Write the generated Rust file — the extern "C" wrappers and their
converters, which cbindgen then reads to emit the header.
Sourcepub fn registry(&self) -> &Registry<()>
pub fn registry(&self) -> &Registry<()>
The resolved registry — conversions, decompositions, and the model.
Sourcepub fn declarations(&self) -> &CbindgenBuilder
pub fn declarations(&self) -> &CbindgenBuilder
What the binding declared.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Cbindgen
impl !Send for Cbindgen
impl !Sync for Cbindgen
impl !UnwindSafe for Cbindgen
impl Freeze for Cbindgen
impl Unpin for Cbindgen
impl UnsafeUnpin for Cbindgen
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