pub trait KclStdLibFn: StdLibFn {
    // Required methods
    fn kcl_clone_box(&self) -> Box<dyn KclStdLibFn>;
    fn function(&self) -> &FunctionExpression;
    fn program(&self) -> &Program;

    // Provided method
    fn std_lib(&self) -> Box<dyn StdLibFn> { ... }
}

Required Methods§

Provided Methods§

source

fn std_lib(&self) -> Box<dyn StdLibFn>

Trait Implementations§

source§

impl Clone for Box<dyn KclStdLibFn>

source§

fn clone(&self) -> Box<dyn KclStdLibFn>

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<'de> Deserialize<'de> for Box<dyn KclStdLibFn>

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

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

impl JsonSchema for dyn KclStdLibFn

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

impl Serialize for Box<dyn KclStdLibFn>

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl TS for dyn KclStdLibFn

source§

const EXPORT_TO: Option<&'static str> = _

source§

fn name() -> String

Name of this type in TypeScript.
source§

fn dependencies() -> Vec<Dependency>
where Self: 'static,

Information about types this type depends on. This is used for resolving imports when exporting to a file.
source§

fn transparent() -> bool

true if this is a transparent type, e.g tuples or a list.
This is used for resolving imports when using the export! macro.
source§

fn decl() -> String

Declaration of this type, e.g. interface User { user_id: number, ... }. This function will panic if the type has no declaration.
source§

fn name_with_type_args(args: Vec<String>) -> String

Name of this type in TypeScript, with type arguments.
source§

fn inline() -> String

Formats this types definition in TypeScript, e.g { user_id: number }. This function will panic if the type cannot be inlined.
source§

fn inline_flattened() -> String

Flatten an type declaration.
This function will panic if the type cannot be flattened.
source§

fn export() -> Result<(), ExportError>
where Self: 'static,

Manually export this type to a file. The output file can be specified by annotating the type with #[ts(export_to = ".."]. By default, the filename will be derived from the types name. Read more
source§

fn export_to(path: impl AsRef<Path>) -> Result<(), ExportError>
where Self: 'static,

Manually export this type to a file with a file with the specified path. This function will ignore the #[ts(export_to = "..)] attribute.
source§

fn export_to_string() -> Result<String, ExportError>
where Self: 'static,

Manually generate bindings for this type, returning a String.
This function does not format the output, even if the format feature is enabled.

Implementors§