pub struct UnownedContext { /* private fields */ }
Expand description
Non-owning handle to a CUDA context.
Implementations
sourceimpl UnownedContext
impl UnownedContext
sourcepub fn get_api_version(&self) -> CudaResult<CudaApiVersion>
pub fn get_api_version(&self) -> CudaResult<CudaApiVersion>
Get the API version used to create this context.
This is not necessarily the latest version supported by the driver.
Example
let context = Context::create_and_push(ContextFlags::MAP_HOST | ContextFlags::SCHED_AUTO, device)?;
let unowned = context.get_unowned();
let version = unowned.get_api_version()?;
Trait Implementations
sourceimpl Clone for UnownedContext
impl Clone for UnownedContext
sourcefn clone(&self) -> UnownedContext
fn clone(&self) -> UnownedContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ContextHandle for UnownedContext
impl ContextHandle for UnownedContext
sourceimpl Debug for UnownedContext
impl Debug for UnownedContext
impl Send for UnownedContext
impl Sync for UnownedContext
Auto Trait Implementations
impl RefUnwindSafe for UnownedContext
impl Unpin for UnownedContext
impl UnwindSafe for UnownedContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more