Struct oxi_types::Object

source ·
#[repr(C)]
pub struct Object { /* private fields */ }
Expand description

Binding to a Neovim object.

Represents any valid Neovim type.

Implementations§

source§

impl Object

source

pub fn nil() -> Self

Returns a new nil object.

source

pub fn is_nil(&self) -> bool

source

pub fn is_some(&self) -> bool

source

pub fn from_luaref(luaref: LuaRef) -> Self

source

pub fn kind(&self) -> ObjectKind

source

pub unsafe fn as_boolean_unchecked(&self) -> bool

§Safety

TODO

source

pub unsafe fn as_integer_unchecked(&self) -> Integer

§Safety

TODO

source

pub unsafe fn as_float_unchecked(&self) -> Float

§Safety

TODO

source

pub unsafe fn as_luaref_unchecked(&self) -> LuaRef

§Safety

TODO

source

pub unsafe fn into_string_unchecked(self) -> String

§Safety

TODO

Extracts the contained String value without checking that the object actually contains a String.

source

pub unsafe fn into_array_unchecked(self) -> Array

§Safety

TODO

Extracts the contained Array value without checking that the object actually contains an Array.

source

pub unsafe fn into_dict_unchecked(self) -> Dictionary

§Safety

TODO

Extracts the contained Dictionary value without checking that the object actually contains a Dictionary.

Trait Implementations§

source§

impl Clone for Object

source§

fn clone(&self) -> Self

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 Debug for Object

source§

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

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

impl Default for Object

source§

fn default() -> Object

Returns the “default value” for a type. Read more
source§

impl Drop for Object

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<&str> for Object

source§

fn from(s: &str) -> Self

Converts to this type from the input type.
source§

impl From<()> for Object

source§

fn from(_: ()) -> Self

Converts to this type from the input type.
source§

impl From<Array> for Object

source§

fn from(array: Array) -> Self

Converts to this type from the input type.
source§

impl<T> From<Box<T>> for Object
where Object: From<T>,

source§

fn from(boxed: Box<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Cow<'_, T>> for Object
where T: Clone, Object: From<T>,

source§

fn from(moo: Cow<'_, T>) -> Self

Converts to this type from the input type.
source§

impl From<Cow<'_, str>> for Object

source§

fn from(moo: Cow<'_, str>) -> Self

Converts to this type from the input type.
source§

impl From<Dictionary> for Object

source§

fn from(dictionary: Dictionary) -> Self

Converts to this type from the input type.
source§

impl<A, R> From<Function<A, R>> for Object

source§

fn from(fun: Function<A, R>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Option<T>> for Object
where Object: From<T>,

source§

fn from(maybe: Option<T>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Object

source§

fn from(s: String) -> Self

Converts to this type from the input type.
source§

impl From<String> for Object

source§

fn from(string: String) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Object

source§

fn from(boolean: Boolean) -> Self

Converts to this type from the input type.
source§

impl From<char> for Object

source§

fn from(ch: char) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Object

source§

fn from(n: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Object

source§

fn from(float: Float) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Object

source§

fn from(i: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Object

source§

fn from(i: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Object

source§

fn from(integer: Integer) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Object

source§

fn from(i: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Object

source§

fn from(i: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Object

source§

fn from(i: u32) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Object

source§

fn from(i: u8) -> Self

Converts to this type from the input type.
source§

impl<K, V> FromIterator<(K, V)> for Object
where String: From<K>, Object: From<V>,

source§

fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T> FromIterator<T> for Object
where T: Into<Object>,

source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromObject for Object

source§

impl PartialEq for Object

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Poppable for Object

source§

unsafe fn pop(lstate: *mut lua_State) -> Result<Self, Error>

Pops the value at the top of the stack.
source§

impl Pushable for Object

source§

unsafe fn push(self, lstate: *mut lua_State) -> Result<c_int, Error>

Pushes all its values on the Lua stack, returning the number of values that it pushed.

Auto Trait Implementations§

§

impl RefUnwindSafe for Object

§

impl !Send for Object

§

impl !Sync for Object

§

impl Unpin for Object

§

impl UnwindSafe for Object

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> ToObject for T
where T: Into<Object>,

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.