Trait neon::borrow::Borrow [−][src]
pub trait Borrow: Sized { type Target: Pointer; fn try_borrow<'a>(
self,
lock: &'a Lock<'a>
) -> Result<Ref<'a, Self::Target>, LoanError>; fn borrow<'a>(self, lock: &'a Lock<'a>) -> Ref<'a, Self::Target> { ... } }
A trait for JS values whose internal contents can be borrowed immutably by Rust while the JS engine is locked.
Associated Types
Loading content...Required methods
fn try_borrow<'a>(
self,
lock: &'a Lock<'a>
) -> Result<Ref<'a, Self::Target>, LoanError>
[src]
self,
lock: &'a Lock<'a>
) -> Result<Ref<'a, Self::Target>, LoanError>
Borrow the contents of this value immutably.
If there is already an outstanding mutable loan for this value, this method fails with a LoanError
.
Provided methods
fn borrow<'a>(self, lock: &'a Lock<'a>) -> Ref<'a, Self::Target>
[src]
Borrow the contents of this value immutably.
If there is already an outstanding mutable loan for this value, this method panics.
Implementations on Foreign Types
Loading content...Implementors
impl<'a> Borrow for &'a JsArrayBuffer
[src]
impl<'a> Borrow for &'a JsArrayBuffer
[src]type Target = BinaryData<'a>
fn try_borrow<'b>(
self,
guard: &'b Lock<'b>
) -> Result<Ref<'b, Self::Target>, LoanError>
[src]
self,
guard: &'b Lock<'b>
) -> Result<Ref<'b, Self::Target>, LoanError>
impl<'a> Borrow for &'a JsBuffer
[src]
impl<'a> Borrow for &'a JsBuffer
[src]type Target = BinaryData<'a>
fn try_borrow<'b>(
self,
guard: &'b Lock<'b>
) -> Result<Ref<'b, Self::Target>, LoanError>
[src]
self,
guard: &'b Lock<'b>
) -> Result<Ref<'b, Self::Target>, LoanError>
impl<'a> Borrow for &'a mut JsArrayBuffer
[src]
impl<'a> Borrow for &'a mut JsArrayBuffer
[src]type Target = BinaryData<'a>
fn try_borrow<'b>(
self,
guard: &'b Lock<'b>
) -> Result<Ref<'b, Self::Target>, LoanError>
[src]
self,
guard: &'b Lock<'b>
) -> Result<Ref<'b, Self::Target>, LoanError>