pub struct NamedViewArtifact {
pub id: ArtifactId,
pub name: String,
pub camera: ArtifactCameraView,
pub baseline: ArtifactVisibility,
pub show_ids: Vec<ArtifactId>,
pub hide_ids: Vec<ArtifactId>,
pub code_ref: CodeRef,
}Expand description
A named view declared in KCL by view::named: a display name, camera intent
and the objects the view shows or hides.
The view is data for a consumer to activate later, so this artifact holds no engine geometry and its creation sends no engine command. The objects are named by ARTIFACT id, so a consumer resolves each one through the artifact graph; an extruded solid’s engine id differs from its artifact id, and the translation belongs to whoever applies the view.
Fields§
§id: ArtifactId§name: StringThe display name the author gave the view. Required, and unique among the views declared by the same module.
camera: ArtifactCameraView§baseline: ArtifactVisibilityWhether objects start visible or hidden, which decides which of the two lists below can act.
show_ids: Vec<ArtifactId>Artifacts the view shows. Meaningful under a Hide baseline, where they
are the only visible objects.
hide_ids: Vec<ArtifactId>Artifacts the view hides. Meaningful under a Show baseline, where they
are the only hidden objects.
code_ref: CodeRefTrait Implementations§
Source§impl Clone for NamedViewArtifact
impl Clone for NamedViewArtifact
Source§fn clone(&self) -> NamedViewArtifact
fn clone(&self) -> NamedViewArtifact
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NamedViewArtifact
impl Debug for NamedViewArtifact
Source§impl<'de> Deserialize<'de> for NamedViewArtifact
impl<'de> Deserialize<'de> for NamedViewArtifact
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for NamedViewArtifact
impl JsonSchema for NamedViewArtifact
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for NamedViewArtifact
impl PartialEq for NamedViewArtifact
Source§impl Serialize for NamedViewArtifact
impl Serialize for NamedViewArtifact
impl StructuralPartialEq for NamedViewArtifact
Source§impl TS for NamedViewArtifact
impl TS for NamedViewArtifact
Source§type WithoutGenerics = NamedViewArtifact
type WithoutGenerics = NamedViewArtifact
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 moreSource§type OptionInnerType = NamedViewArtifact
type OptionInnerType = NamedViewArtifact
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read moreSource§fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
Auto Trait Implementations§
impl Freeze for NamedViewArtifact
impl RefUnwindSafe for NamedViewArtifact
impl Send for NamedViewArtifact
impl Sync for NamedViewArtifact
impl Unpin for NamedViewArtifact
impl UnsafeUnpin for NamedViewArtifact
impl UnwindSafe for NamedViewArtifact
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more