pub struct Config {
    cdylib_name: Option<String>,
    module_name: Option<String>,
    ffi_module_name: Option<String>,
    ffi_module_filename: Option<String>,
    generate_module_map: Option<bool>,
    omit_argument_labels: Option<bool>,
    generate_immutable_records: Option<bool>,
    experimental_sendable_value_types: Option<bool>,
    custom_types: HashMap<String, CustomTypeConfig>,
}
Expand description

Config options for the caller to customize the generated Swift.

Note that this can only be used to control details of the Swift that do not affect the underlying component, since the details of the underlying component are entirely determined by the ComponentInterface.

Fields§

§cdylib_name: Option<String>§module_name: Option<String>§ffi_module_name: Option<String>§ffi_module_filename: Option<String>§generate_module_map: Option<bool>§omit_argument_labels: Option<bool>§generate_immutable_records: Option<bool>§experimental_sendable_value_types: Option<bool>§custom_types: HashMap<String, CustomTypeConfig>

Implementations§

source§

impl Config

source

pub fn module_name(&self) -> String

The name of the Swift module containing the high-level foreign-language bindings.

source

pub fn ffi_module_name(&self) -> String

The name of the lower-level C module containing the FFI declarations.

source

pub fn ffi_module_filename(&self) -> String

The filename stem for the lower-level C module containing the FFI declarations.

source

pub fn modulemap_filename(&self) -> String

The name of the .modulemap file for the lower-level C module with FFI declarations.

source

pub fn header_filename(&self) -> String

The name of the .h file for the lower-level C module with FFI declarations.

source

pub fn cdylib_name(&self) -> String

The name of the compiled Rust library containing the FFI implementation.

source

pub fn generate_module_map(&self) -> bool

Whether to generate a .modulemap file for the lower-level C module with FFI declarations.

source

pub fn omit_argument_labels(&self) -> bool

Whether to omit argument labels in Swift function definitions.

source

pub fn generate_immutable_records(&self) -> bool

Whether to generate immutable records (let instead of var)

source

pub fn experimental_sendable_value_types(&self) -> bool

Whether to mark value types as ‘Sendable’

Trait Implementations§

source§

impl BindingsConfig for Config

source§

fn update_from_ci(&mut self, ci: &ComponentInterface)

Update missing values using the ComponentInterface
source§

fn update_from_cdylib_name(&mut self, cdylib_name: &str)

Update missing values using the dylib file for the main crate, when in library mode. Read more
source§

fn update_from_dependency_configs(&mut self, _config_map: HashMap<&str, &Self>)

Update missing values from config instances from dependent crates Read more
source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Config

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Config

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,