pub struct Field {
pub name: NameContainer,
pub teal_type: Cow<'static, [NamePart]>,
pub ty: Type,
}Expand description
Represents a field, containing both the name and its type
Fields§
§name: NameContainerthe name of the field
teal_type: Cow<'static, [NamePart]>the type of the field, according to the old format
ty: Typethe type of the field
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Field
impl<'de> Deserialize<'de> for Field
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<(NameContainer, Type)> for Field
impl From<(NameContainer, Type)> for Field
Source§fn from((name, ty): (NameContainer, Type)) -> Self
fn from((name, ty): (NameContainer, Type)) -> Self
Converts to this type from the input type.
Source§impl ToTypename for Field
impl ToTypename for Field
Source§fn to_typename() -> Type
fn to_typename() -> Type
generates the type representation
Source§fn to_old_type_parts() -> Cow<'static, [NamePart]>
fn to_old_type_parts() -> Cow<'static, [NamePart]>
👎Deprecated
Used to get the old representation.
Should basically never be used or implemented manually
Source§fn to_function_param() -> Vec<FunctionParam>
fn to_function_param() -> Vec<FunctionParam>
generates the type representation when used as a parameter
By default will assume no name was given Read more
Source§impl TypeBody for Field
impl TypeBody for Field
Source§fn get_type_body() -> TypeGenerator
fn get_type_body() -> TypeGenerator
Fills in the TypeGenerator so a .d.tl file can be constructed.
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
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§impl<T> FromLuaMulti for Twhere
T: FromLua,
impl<T> FromLuaMulti for Twhere
T: FromLua,
Source§fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
Performs the conversion. Read more
fn from_lua_args( args: MultiValue, i: usize, to: Option<&str>, lua: &Lua, ) -> Result<T, Error>
unsafe fn from_stack_multi(nvals: i32, lua: &RawLua) -> Result<T, Error>
unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &RawLua, ) -> Result<T, Error>
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
Source§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.
unsafe fn push_into_stack_multi(self, lua: &RawLua) -> Result<i32, Error>
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<A> TealMultiValue for Awhere
A: ToTypename,
impl<A> TealMultiValue for Awhere
A: ToTypename,
Source§fn get_types_as_params() -> Vec<FunctionParam>
fn get_types_as_params() -> Vec<FunctionParam>
Gets the type representations as used for function parameters
Source§impl<T> TypeName for Twhere
T: ToTypename,
impl<T> TypeName for Twhere
T: ToTypename,
Source§fn get_type_parts() -> Cow<'static, [NamePart]>
fn get_type_parts() -> Cow<'static, [NamePart]>
returns the type name as how it should show up in the generated
.d.tl fileSource§fn get_type_parts_as_global() -> Cow<'static, [NamePart]>
fn get_type_parts_as_global() -> Cow<'static, [NamePart]>
Generates the typename when used to describe a global value. Read more
Source§fn get_type_kind() -> KindOfType
fn get_type_kind() -> KindOfType
This method tells the generator if this type is builtin to teal/lua, if it comes from somewhere else or if it stands in as a generic Read more
Source§fn collect_children(_: &mut Vec<TealType>)
fn collect_children(_: &mut Vec<TealType>)
Creates/updates a list of every child type this type has
This is used to properly label methods/functions as being generic.