#[repr(C)]pub struct Object { /* private fields */ }
Expand description
Binding to a Neovim object.
Represents any valid Neovim type.
Implementations§
Source§impl Object
impl Object
pub fn is_nil(&self) -> bool
pub fn is_some(&self) -> bool
pub fn from_luaref(luaref: LuaRef) -> Self
pub fn kind(&self) -> ObjectKind
Sourcepub unsafe fn as_boolean_unchecked(&self) -> bool
pub unsafe fn as_boolean_unchecked(&self) -> bool
Returns the boolean stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
Boolean
. Calling this method on an Object
with any other kind may result in undefined behavior.
Sourcepub unsafe fn as_boolean_unchecked_mut(&mut self) -> &mut bool
pub unsafe fn as_boolean_unchecked_mut(&mut self) -> &mut bool
Returns a mutable reference to the boolean stored in this
Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
Boolean
. Calling this method on an Object
with any other kind may result in undefined behavior.
Sourcepub unsafe fn as_integer_unchecked(&self) -> Integer
pub unsafe fn as_integer_unchecked(&self) -> Integer
Returns the integer stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be one of
Integer
, Buffer
,
Window
, or TabPage
.
Calling this method on an Object
with any other kind may result in
undefined
behavior.
Sourcepub unsafe fn as_integer_unchecked_mut(&mut self) -> &mut Integer
pub unsafe fn as_integer_unchecked_mut(&mut self) -> &mut Integer
Returns a mutable reference to the integer stored in this
Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be one of
Integer
, Buffer
,
Window
, or TabPage
.
Calling this method on an Object
with any other kind may result in
undefined
behavior.
Sourcepub unsafe fn as_float_unchecked(&self) -> Float
pub unsafe fn as_float_unchecked(&self) -> Float
Returns the float stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a Float
.
Calling this method on an Object
with any other kind may result in
undefined behavior.
Sourcepub unsafe fn as_float_unchecked_mut(&mut self) -> &mut Float
pub unsafe fn as_float_unchecked_mut(&mut self) -> &mut Float
Returns a mutable reference to the float stored in this
Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a Float
.
Calling this method on an Object
with any other kind may result in
undefined behavior.
Sourcepub unsafe fn as_luaref_unchecked(&self) -> LuaRef
pub unsafe fn as_luaref_unchecked(&self) -> LuaRef
Returns the Lua reference stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
LuaRef
. Calling this method on an Object
with
any other kind may result in undefined behavior.
Sourcepub unsafe fn as_luaref_unchecked_mut(&mut self) -> &mut LuaRef
pub unsafe fn as_luaref_unchecked_mut(&mut self) -> &mut LuaRef
Returns a mutable reference to the Lua reference stored in this
Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
LuaRef
. Calling this method on an Object
with
any other kind may result in undefined behavior.
Sourcepub unsafe fn as_nvim_str_unchecked(&self) -> NvimStr<'_>
pub unsafe fn as_nvim_str_unchecked(&self) -> NvimStr<'_>
Returns a reference to the string stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
String
. Calling this method on an Object
with
any other kind may result in undefined behavior.
Sourcepub unsafe fn into_string_unchecked(self) -> NvimString
pub unsafe fn into_string_unchecked(self) -> NvimString
Returns the string stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
String
. Calling this method on an Object
with
any other kind may result in undefined behavior.
Sourcepub unsafe fn as_array_unchecked(&self) -> &Array
pub unsafe fn as_array_unchecked(&self) -> &Array
Returns a reference to the array stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be an Array
.
Calling this method on an Object
with any other kind may result in
undefined behavior.
Sourcepub unsafe fn as_array_unchecked_mut(&mut self) -> &mut Array
pub unsafe fn as_array_unchecked_mut(&mut self) -> &mut Array
Returns a mutable reference to the array stored in this
Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be an Array
.
Calling this method on an Object
with any other kind may result in
undefined behavior.
Sourcepub unsafe fn into_array_unchecked(self) -> Array
pub unsafe fn into_array_unchecked(self) -> Array
Returns the array stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be an Array
.
Calling this method on an Object
with any other kind may result in
undefined behavior.
Sourcepub unsafe fn as_dictionary_unchecked(&self) -> &Dictionary
pub unsafe fn as_dictionary_unchecked(&self) -> &Dictionary
Returns a reference to the dictionary stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
Dictionary
. Calling this method on an
Object
with any other kind may result in undefined behavior.
Sourcepub unsafe fn as_dictionary_unchecked_mut(&mut self) -> &mut Dictionary
pub unsafe fn as_dictionary_unchecked_mut(&mut self) -> &mut Dictionary
Returns a mutable reference to the dictionary stored in this
Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
Dictionary
. Calling this method on an
Object
with any other kind may result in undefined behavior.
Sourcepub unsafe fn into_dictionary_unchecked(self) -> Dictionary
pub unsafe fn into_dictionary_unchecked(self) -> Dictionary
Returns the dictionary stored in this Object
.
This is a zero-cost method that directly accesses the underlying value without performing any runtime checks.
§Safety
This Object
’s ObjectKind
must be a
Dictionary
. Calling this method on an
Object
with any other kind may result in undefined behavior.
Trait Implementations§
Source§impl From<Dictionary> for Object
impl From<Dictionary> for Object
Source§fn from(dictionary: Dictionary) -> Self
fn from(dictionary: Dictionary) -> Self
Source§impl From<String> for Object
impl From<String> for Object
Source§fn from(string: NvimString) -> Self
fn from(string: NvimString) -> Self
Source§impl<K, V> FromIterator<(K, V)> for Object
impl<K, V> FromIterator<(K, V)> for Object
Source§impl<T> FromIterator<T> for Object
impl<T> FromIterator<T> for Object
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Source§impl FromObject for Object
impl FromObject for Object
Source§impl TryFrom<Object> for Dictionary
impl TryFrom<Object> for Dictionary
Auto Trait Implementations§
impl Freeze for Object
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> 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,
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§type Error = Infallible
type Error = Infallible
Result
.Source§fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
Result
.