[−][src]Struct emacs::Value
A type that represents Lisp values.
Values of this type can be copied around, but are lifetime-bound to the Env
they come from.
They are also "proxy values" that are only useful when converted to Rust values, or used as arguments when calling back into the Lisp runtime.
Fields
env: &'e Env
Methods
impl<'e> Value<'e>
[src]
pub fn into_rust<T: FromLisp<'e>>(self) -> Result<T>
[src]
Converts this value into a Rust value of the given type.
pub fn into_ref<T>(self) -> Result<Ref<'e, T>>
[src]
pub fn into_ref_mut<T>(self) -> Result<RefMut<'e, T>>
[src]
pub unsafe fn get_mut<T: Transfer>(&mut self) -> Result<&mut T>
[src]
Returns a mutable reference to the underlying Rust data wrapped by this value.
Safety
There are several ways this can go wrong:
- Lisp code can pass the same object through 2 different values in an argument list.
- Rust code earlier in the call chain may have copied this value.
- Rust code later in the call chain may receive a copy of this value.
In general, it is better to wrap Rust data in RefCell
, Mutex
, or RwLock
guards, before
moving them to Lisp, and then only access them through these guards (which can be obtained
back through into_rust
). This method is for squeezing out the last bit of performance in
very rare situations.
Trait Implementations
impl<'a, 'e: 'a> FromLisp<'e> for Value<'a>
[src]
impl<'e> IntoLisp<'e> for Value<'e>
[src]
impl<'e> Copy for Value<'e>
[src]
impl<'e> Clone for Value<'e>
[src]
fn clone(&self) -> Value<'e>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'e> Debug for Value<'e>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,