Trait kcl_lib::std::kcl_stdlib::KclStdLibFn

source ·
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

§

type WithoutGenerics = dyn KclStdLibFn

If this type does not have generic parameters, then WithoutGenerics should just be Self. If the type does have generic parameters, then all generic parameters must be replaced with a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that EXPORT_TO must be None. Read more
source§

fn name() -> String

Name of this type in TypeScript, including generic parameters
source§

fn decl() -> String

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

fn decl_concrete() -> String

Declaration of this type using the supplied generic arguments. The resulting TypeScript definition will not be generic. For that, see TS::decl(). If this type is not generic, then this function is equivalent to TS::decl().
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 a type declaration.
This function will panic if the type cannot be flattened.
source§

fn output_path() -> Option<&'static Path>

Returns the output path to where T should be exported.
The returned path does not include the base directory from TS_RS_EXPORT_DIR. Read more
source§

const DOCS: Option<&'static str> = None

JSDoc comment to describe this type in TypeScript - when TS is derived, docs are automatically read from your doc comments or #[doc = ".."] attributes
source§

fn ident() -> String

Identifier of this type, excluding generic parameters.
source§

fn visit_dependencies(_: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all dependency of this type.
source§

fn visit_generics(_: &mut impl TypeVisitor)
where Self: 'static,

Iterates over all type parameters of this type.
source§

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

Resolves all dependencies of this type recursively.
source§

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

Manually export this type to the filesystem. To export this type together with all of its dependencies, use TS::export_all. Read more
source§

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

Manually export this type to the filesystem, together with all of its dependencies.
To export only this type, without its dependencies, use TS::export. Read more
source§

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

Manually export this type into the given directory, together with all of its dependencies.
To export only this type, without its dependencies, use TS::export. Read more
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. Read more
source§

fn default_output_path() -> Option<PathBuf>

Returns the output path to where T should be exported. Read more

Implementors§