Skip to main content

LuaError

Enum LuaError 

Source
#[non_exhaustive]
pub enum LuaError { Io(Error), Inexpressible { handle: String, attribute: String, type_tag: Type, }, InexpressibleFlags { handle: String, attribute: String, flags: i32, }, EmptyStringArray { handle: String, attribute: String, }, CreateArguments { handle: String, node_type: String, }, }
Expand description

Why a scene could not be written as a Lua script.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Io(Error)

Writing failed.

§

Inexpressible

ɴsɪ’s Lua binding has no name for this attribute’s type.

f64 and i64 arguments have no Lua spelling: nsi.TypeDouble and nsi.TypeInt64 are nil, and passing a typed parameter whose type is nil is a runtime error in the renderer, while passing the value untyped silently makes a double a float and a large integer a different number.

Fields

§handle: String

The node carrying the attribute.

§attribute: String

The attribute name.

§type_tag: Type

The ɴsɪ type that has no Lua spelling.

§

InexpressibleFlags

The argument carries ɴsɪ flags that its Lua binding cannot express.

A Lua parameter table has name, data, type and arraylength – and nothing for per_vertex, per_face or linear_interpolation. Emitting the argument without them rebuilds a different surface: a per-vertex normal becomes a per-varying one, which on a subdivision mesh is a different shape. Verified against 3Delight: every spelling of a flag key is ignored.

Fields

§handle: String

The node carrying the attribute.

§attribute: String

The attribute name.

§flags: i32

The flags that have no Lua spelling.

§

EmptyStringArray

An empty string array.

{name="x", data={}, type=nsi.TypeString} aborts 3Delight with a heap error rather than reporting a problem, so emitting one hands a consumer a script that kills the renderer. Empty numeric arrays are fine.

Fields

§handle: String

The node carrying the attribute.

§attribute: String

The attribute name.

§

CreateArguments

A Create carrying parameters.

ɴsɪ’s Lua nsi.Create takes a handle and a node type and nothing else, while NSICreate and the stream both take optional parameters and 3Delight writes them. Emitting the create without them would drop whatever they said.

Fields

§handle: String

The node being created.

§node_type: String

The type it was created with.

Trait Implementations§

Source§

impl Debug for LuaError

Source§

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

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

impl Display for LuaError

Source§

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

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

impl Error for LuaError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for LuaError

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.