Struct uniffi_bindgen::bindings::gecko_js::gen_gecko_js::Context[][src]

pub struct Context<'config, 'ci> { /* fields omitted */ }

A context associates config options with a component interface, and provides helper methods that are shared between all templates and filters in this module.

Implementations

impl<'config, 'ci> Context<'config, 'ci>[src]

pub fn new(config: &'config Config, ci: &'ci ComponentInterface) -> Self[src]

Creates a new context with options for the given component interface.

pub fn ffi_rustbuffer_type(&self) -> String[src]

Returns the RustBuffer type name.

A RustBuffer is a Plain Old Data struct that holds a pointer to a Rust byte buffer, along with its length and capacity. Because the generated binding for each component declares its own FFI symbols in an extern "C" block, the RustBuffer type name must be unique for each component.

Declaring multiple types with the same name in an extern "C" block, even if they’re in different header files, will fail the build because it violates the One Definition Rule.

pub fn ffi_foreignbytes_type(&self) -> String[src]

Returns the ForeignBytes type name.

ForeignBytes is a Plain Old Data struct that holds a pointer to some memory allocated by C++, along with its length. See the docs for ffi_rustbuffer_type about why this type name must be unique for each component.

pub fn ffi_rusterror_type(&self) -> String[src]

Returns the RustError type name.

A RustError is a Plain Old Data struct that holds an error code and a message string. See the docs for ffi_rustbuffer_type about why this type name must be unique for each component.

pub fn detail_name(&self) -> String[src]

Returns the name to use for the detail C++ namespace, which contains the serialization helpers and other internal types. This name must be unique for each component.

pub fn namespace(&self) -> &'ci str[src]

Returns the unprefixed, unmodified component namespace name. This is exposed for convenience, where a template has access to the context but not the component interface.

pub fn type_name<'a>(&self, ident: &'a str) -> Cow<'a, str>[src]

Returns the type name to use for an interface, dictionary, enum, or namespace with the given ident in the generated WebIDL and C++ code.

pub fn header_name(&self, ident: &str) -> String[src]

Returns the C++ header or source file name to use for the given WebIDL interface or namespace name.

Trait Implementations

impl<'config, 'ci> Clone for Context<'config, 'ci>[src]

impl<'config, 'ci> Copy for Context<'config, 'ci>[src]

Auto Trait Implementations

impl<'config, 'ci> RefUnwindSafe for Context<'config, 'ci>

impl<'config, 'ci> Send for Context<'config, 'ci>

impl<'config, 'ci> Sync for Context<'config, 'ci>

impl<'config, 'ci> Unpin for Context<'config, 'ci>

impl<'config, 'ci> UnwindSafe for Context<'config, 'ci>

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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.