Struct swift_bridge_ir::SwiftBridgeModule 
source · pub struct SwiftBridgeModule { /* private fields */ }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§
source§impl SwiftBridgeModule
 
impl SwiftBridgeModule
sourcepub fn generate_swift_code_and_c_header(
    &self,
    config: CodegenConfig
) -> SwiftCodeAndCHeader
 
pub fn generate_swift_code_and_c_header( &self, config: CodegenConfig ) -> SwiftCodeAndCHeader
Generate the corresponding Swift code and C header for a bridge module.
source§impl SwiftBridgeModule
 
impl SwiftBridgeModule
sourcepub fn set_swift_bridge_path(&mut self, path: Path)
 
pub fn set_swift_bridge_path(&mut self, path: Path)
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§
source§impl Parse for SwiftBridgeModule
 
impl Parse for SwiftBridgeModule
fn parse(input: ParseStream<'_>) -> Result<Self>
source§impl ToTokens for SwiftBridgeModule
 
impl ToTokens for SwiftBridgeModule
source§fn to_tokens(&self, tokens: &mut TokenStream)
 
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
 
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
    Self: Sized,
 
fn into_token_stream(self) -> TokenStreamwhere Self: Sized,
Auto Trait Implementations§
impl RefUnwindSafe for SwiftBridgeModule
impl !Send for SwiftBridgeModule
impl !Sync for SwiftBridgeModule
impl Unpin for SwiftBridgeModule
impl UnwindSafe for SwiftBridgeModule
Blanket Implementations§
source§impl<T> Spanned for Twhere
    T: Spanned + ?Sized,
 
impl<T> Spanned for Twhere T: Spanned + ?Sized,
source§fn span(&self) -> Span
 
fn span(&self) -> Span
Returns a 
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.