Struct LibraryBuilder

Source
pub struct LibraryBuilder { /* private fields */ }

Implementations§

Source§

impl LibraryBuilder

Source

pub fn new( version: Version, info: LibraryInfo, settings: Rc<LibrarySettings>, ) -> Self

Source

pub fn build(self) -> BindResult<Library>

Source

pub fn define_error_type<T: IntoName>( &mut self, error_name: T, exception_name: T, exception_type: ExceptionType, ) -> BindResult<ErrorTypeBuilder<'_>>

Source

pub fn define_constants<T: IntoName>( &mut self, name: T, ) -> BindResult<ConstantSetBuilder<'_>>

Source

pub fn declare_universal_struct<T: IntoName>( &mut self, name: T, ) -> BindResult<UniversalStructDeclaration>

Source

pub fn declare_function_argument_struct<T: IntoName>( &mut self, name: T, ) -> BindResult<FunctionArgStructDeclaration>

Source

pub fn declare_function_return_struct<T: IntoName>( &mut self, name: T, ) -> BindResult<FunctionReturnStructDeclaration>

Source

pub fn declare_callback_argument_struct<T: IntoName>( &mut self, name: T, ) -> BindResult<CallbackArgStructDeclaration>

Source

pub fn define_universal_struct( &mut self, declaration: UniversalStructDeclaration, ) -> BindResult<UniversalStructBuilder<'_>>

Define a structure that can be used in any context.

Backends will generate bidirectional conversion routines for this type of struct.

Source

pub fn define_opaque_struct( &mut self, declaration: UniversalStructDeclaration, ) -> BindResult<UniversalStructBuilder<'_>>

Define an opaque structure which must be of universal type

Source

pub fn define_callback_argument_struct<T>( &mut self, declaration: T, ) -> BindResult<CallbackArgStructBuilder<'_>>

Define a structure that can be only be used in callback function arguments

Source

pub fn define_function_return_struct<T>( &mut self, declaration: T, ) -> BindResult<FunctionReturnStructBuilder<'_>>

Define a structure that can only be used as function return value

Source

pub fn define_function_argument_struct<T>( &mut self, declaration: T, ) -> BindResult<FunctionArgStructBuilder<'_>>

Define a structure that can only be be used as a function argument

Source

pub fn define_enum<T: IntoName>( &mut self, name: T, ) -> BindResult<EnumBuilder<'_>>

Define an enumeration

Source

pub fn define_function<T: IntoName>( &mut self, name: T, ) -> BindResult<FunctionBuilder<'_>>

Source

pub fn define_method<T: IntoName>( &mut self, name: T, class: ClassDeclarationHandle, ) -> BindResult<ClassMethodBuilder<'_>>

Source

pub fn define_future_method<T: IntoName>( &mut self, name: T, class: ClassDeclarationHandle, future: FutureInterface<Unvalidated>, ) -> BindResult<FutureMethodBuilder<'_>>

Source

pub fn define_constructor( &mut self, class: ClassDeclarationHandle, ) -> BindResult<ClassConstructorBuilder<'_>>

Source

pub fn define_destructor<D: Into<Doc<Unvalidated>>>( &mut self, class: ClassDeclarationHandle, doc: D, ) -> BindResult<ClassDestructor<Unvalidated>>

Source

pub fn declare_class<T: IntoName>( &mut self, name: T, ) -> BindResult<ClassDeclarationHandle>

Source

pub fn define_class( &mut self, declaration: &ClassDeclarationHandle, ) -> BindResult<ClassBuilder<'_>>

Source

pub fn define_static_class<T: IntoName>( &mut self, name: T, ) -> BindResult<StaticClassBuilder<'_>>

Source

pub fn define_future_interface<T: IntoName, D: Into<Doc<Unvalidated>>, E: Into<DocString<Unvalidated>>, V: Into<CallbackArgument>>( &mut self, name: T, interface_docs: D, value_type: V, value_type_docs: E, error_type: ErrorType<Unvalidated>, ) -> BindResult<FutureInterface<Unvalidated>>

A future interface is a specialized asynchronous which consists of a single callback method providing a single value. The callback represents the completion of a “future” and is mapped appropriately in backends.

Source

pub fn define_interface<T: IntoName, D: Into<Doc<Unvalidated>>>( &mut self, name: T, doc: D, ) -> BindResult<InterfaceBuilder<'_>>

Source

pub fn define_iterator<N: IntoName, T: Into<IteratorItemType>>( &mut self, class_name: N, item_type: T, ) -> BindResult<AbstractIteratorHandle>

Source

pub fn define_iterator_with_lifetime<N: IntoName, T: Into<IteratorItemType>>( &mut self, class_name: N, item_type: T, ) -> BindResult<AbstractIteratorHandle>

Source

pub fn define_collection<N: IntoName, A: Into<FunctionArgument>>( &mut self, class_name: N, value_type: A, has_reserve: bool, ) -> BindResult<CollectionHandle>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more