Skip to main content

EmitConfig

Struct EmitConfig 

Source
pub struct EmitConfig {
    pub external_types: BTreeMap<String, String>,
    pub bigint_behavior: BigIntBehavior,
    pub case_default: Option<RenameAll>,
    pub strict_unsupported: bool,
    pub quote_style: QuoteStyle,
}
Expand description

Per-build configuration for an crate::emit call.

The full surface is in place for PR 1, but later PRs wire the individual fields into the emission path:

  • external_types is consumed by PR 3’s use-resolution + external-types lookup
  • bigint_behavior is consumed by PR 1’s emit_type for u64/i64
  • case_default is consumed by PR 2’s serde-rename engine
  • strict_unsupported is documented but, per the OF-015 design pass, the emitter is hard-error only — the field exists today to keep the EmitConfig shape stable across the PR series, and the strict path is the only path the emitter takes regardless of the flag’s value. The field will be removed entirely in a later PR if no consumer surfaces a reason to keep it; see OF-015 scope item 6 for the rationale.

Fields§

§external_types: BTreeMap<String, String>

Canonical-path → TS rendering map for types ontogen-ts treats as terminal. Defaults shipped by PR 3 (chrono::DateTime"string", etc.); user overrides merge on top.

§bigint_behavior: BigIntBehavior

Rendering for 64-bit integer types. Defaults to BigIntBehavior::Number.

§case_default: Option<RenameAll>

Default rename_all mode applied to types that don’t specify one. None means “respect each type’s own annotation; emit fields as-is otherwise.”

§strict_unsupported: bool

Reserved for future use. Per the OF-015 design pass the emitter is hard-error only; this flag is currently a no-op and exists to keep the public shape stable across the PR series.

§quote_style: QuoteStyle

Quote style applied to every TS string literal the emitter renders. Defaults to QuoteStyle::Single for byte-identical output with pre-knob consumers.

Trait Implementations§

Source§

impl Clone for EmitConfig

Source§

fn clone(&self) -> EmitConfig

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 EmitConfig

Source§

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

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

impl Default for EmitConfig

Source§

fn default() -> EmitConfig

Returns the “default value” for a type. 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, 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.