Struct swift_bridge_ir::SwiftBridgeModule[][src]

pub struct SwiftBridgeModule { /* fields omitted */ }
Expand description

Represents a type definition within an extern "Rust" module, as well as all of its methods.

#[swift_bridge::bridge]
mod ffi {
    extern "Rust" {
        type Stack;

        fn push(&mut self, val: u8);

        fn pop(self: &mut Stack) -> Option<u8>;

        fn as_ptr(&self) -> *const u8;

        fn len(self: &Stack) -> usize;

        fn consume(self);
    }

    extern "Swift" {
        // TODO: Examples
    }
}

Implementations

Generate the contents of a C header file based on the contents of this module.

Generate the corresponding Swift code for the bridging module.

Set the path used for swift_bridge types such as swift_bridge::RustString. We set this to crate when we’re inside of the swift_bridge crate.

Trait Implementations

Write self to the given TokenStream. Read more

Convert self directly into a TokenStream object. Read more

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.