Skip to main content

nil

Struct nil 

Source
pub struct nil;
Expand description

The type of the absence of a value.

nil has a single value, also called nil, whose main property is to be different from every other value. It usually represents a missing or deleted value: assigning nil to a table field removes that field, and reading a variable that was never assigned yields nil.

In a condition, nil (together with false) counts as false; every other value counts as true.

Trait Implementations§

Source§

impl tostring for nil

Source§

fn __tostring(&self) -> string

Invoked by tostring() (and therefore by print) to convert the value to a string. Read more
Source§

fn __name(&self) -> string

A string naming the type of the value, used in error messages and by tostring when __tostring is absent. Read more

Auto Trait Implementations§

§

impl Freeze for nil

§

impl RefUnwindSafe for nil

§

impl Send for nil

§

impl Sync for nil

§

impl Unpin for nil

§

impl UnsafeUnpin for nil

§

impl UnwindSafe for nil

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<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, 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.