Struct specta_typescript::Typescript
source · #[non_exhaustive]pub struct Typescript {
pub header: Cow<'static, str>,
pub remove_default_header: bool,
pub bigint: BigIntExportBehavior,
pub comment_exporter: Option<CommentFormatterFn>,
pub formatter: Option<FormatterFn>,
}
Expand description
Typescript language exporter.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.header: Cow<'static, str>
The file’s header
remove_default_header: bool
Should we remove the default header?
bigint: BigIntExportBehavior
How BigInts should be exported.
comment_exporter: Option<CommentFormatterFn>
How comments should be rendered.
formatter: Option<FormatterFn>
How the resulting file should be formatted.
Implementations§
source§impl Typescript
impl Typescript
sourcepub fn header(self, header: impl Into<Cow<'static, str>>) -> Self
pub fn header(self, header: impl Into<Cow<'static, str>>) -> Self
Configure a header for the file.
This is perfect for configuring lint ignore rules or other file-level comments.
sourcepub fn remove_default_header(self) -> Self
pub fn remove_default_header(self) -> Self
Removes the default Specta header from the output.
sourcepub fn bigint(self, bigint: BigIntExportBehavior) -> Self
pub fn bigint(self, bigint: BigIntExportBehavior) -> Self
Configure the BigInt handling behaviour
sourcepub fn comment_style(self, exporter: CommentFormatterFn) -> Self
pub fn comment_style(self, exporter: CommentFormatterFn) -> Self
Trait Implementations§
source§impl Clone for Typescript
impl Clone for Typescript
source§fn clone(&self) -> Typescript
fn clone(&self) -> Typescript
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Typescript
impl Debug for Typescript
source§impl Default for Typescript
impl Default for Typescript
Auto Trait Implementations§
impl Freeze for Typescript
impl RefUnwindSafe for Typescript
impl Send for Typescript
impl Sync for Typescript
impl Unpin for Typescript
impl UnwindSafe for Typescript
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)