Skip to main content

CallConfig

Struct CallConfig 

Source
pub struct CallConfig {
Show 17 fields pub function: String, pub module: String, pub result_var: String, pub async: bool, pub path: Option<String>, pub method: Option<String>, pub args: Vec<ArgMapping>, pub overrides: HashMap<String, CallOverride>, pub returns_result: bool, pub returns_void: bool, pub skip_languages: Vec<String>, pub result_is_simple: bool, pub result_is_vec: bool, pub result_is_array: bool, pub result_is_bytes: bool, pub result_is_option: bool, pub select_when: Option<SelectWhen>,
}
Expand description

Configuration for the function call in each test.

Fields§

§function: String

The function name (alef applies language naming conventions).

§module: String

The module/package where the function lives.

§result_var: String

Variable name for the return value (default: “result”).

§async: bool

Whether the function is async.

§path: Option<String>

HTTP endpoint path for mock server routing (e.g., "/v1/chat/completions").

Required when fixtures use mock_response. The Rust e2e generator uses this to build the MockRoute that the mock server matches against.

§method: Option<String>

HTTP method for mock server routing (default: "POST").

Used together with path when building MockRoute entries.

§args: Vec<ArgMapping>

How fixture input fields map to function arguments.

§overrides: HashMap<String, CallOverride>

Per-language overrides for module/function/etc.

§returns_result: bool

Whether the function returns Result<T, E> in its native binding. Defaults to true. When false, generators that distinguish Result-returning from non-Result-returning calls (currently Rust) will skip the .expect("should succeed") unwrap and bind the raw return value directly.

§returns_void: bool

Whether the function returns only an error/unit — i.e., Result<(), E>.

When combined with returns_result = true, Go generators emit err := func() (single return value) rather than _, err := func() (two return values). This is needed for functions like validate_host that return only error in Go.

§skip_languages: Vec<String>

skip_languages

§result_is_simple: bool

When true, the function returns a primitive (e.g. String, bool, i32) rather than a struct. Generators that would otherwise emit result.<field> will fall back to the bare result variable.

This is a property of the Rust core’s return type and therefore identical across every binding — set it on the call, not in per-language overrides. The same flag is also accepted under [e2e.calls.<name>.overrides.<lang>] for backwards compatibility, but the call-level value takes precedence.

§result_is_vec: bool

When true, the function returns Vec<T> / Array<T>. Generators that support per-element field assertions (rust, csharp) iterate or index into the result; the typescript codegen indexes [0] to mirror csharp.

As with result_is_simple, this is a Rust-side property — set it on the call, not on per-language overrides. Per-language overrides remain supported for backwards compatibility.

§result_is_array: bool

When true (combined with result_is_simple), the simple return is a slice/array (e.g., Vec<String>string[] in TS).

§result_is_bytes: bool

When true, the function returns a raw byte array (Vec<u8>Uint8Array / []byte / byte[]).

§result_is_option: bool

When true, the function returns Option<T>.

§select_when: Option<SelectWhen>

Automatic fixture-routing condition.

When set, a fixture whose call field is None is routed to this named call config if the condition is satisfied. This avoids the need to tag every fixture with "call": "batch_scrape" when the fixture shape already identifies the call.

Example (alef.toml):

[e2e.calls.batch_scrape]
select_when = { input_has = "batch_urls" }

Trait Implementations§

Source§

impl Clone for CallConfig

Source§

fn clone(&self) -> CallConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CallConfig

Source§

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

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

impl Default for CallConfig

Source§

fn default() -> CallConfig

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

impl<'de> Deserialize<'de> for CallConfig

Source§

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

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

impl Serialize for CallConfig

Source§

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

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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 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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,