pub struct SimpleVector<'scope>(/* private fields */);Expand description
A SimpleVector is a fixed-size array that contains WeakValues.
Implementations§
Source§impl<'scope> SimpleVector<'scope>
impl<'scope> SimpleVector<'scope>
Sourcepub fn new<'elem, Tgt, T>(
target: Tgt,
elems: &[T],
) -> SimpleVectorData<'scope, Tgt>
pub fn new<'elem, Tgt, T>( target: Tgt, elems: &[T], ) -> SimpleVectorData<'scope, Tgt>
Create a new SimpleVector that contains every element in elems.
Sourcepub fn with_capacity<Tgt>(
target: Tgt,
n: usize,
) -> SimpleVectorData<'scope, Tgt>where
Tgt: Target<'scope>,
pub fn with_capacity<Tgt>(
target: Tgt,
n: usize,
) -> SimpleVectorData<'scope, Tgt>where
Tgt: Target<'scope>,
Create a new SimpleVector that can hold n values.
Sourcepub unsafe fn with_capacity_uninit<Tgt>(
target: Tgt,
n: usize,
) -> SimpleVectorData<'scope, Tgt>where
Tgt: Target<'scope>,
pub unsafe fn with_capacity_uninit<Tgt>(
target: Tgt,
n: usize,
) -> SimpleVectorData<'scope, Tgt>where
Tgt: Target<'scope>,
Create a new SimpleVector that can hold n values without initializing its contents.
Safety: The contents must be set before calling Julia again, the contents must never be accessed before all elements are set.
Sourcepub fn copy<'target, Tgt>(self, target: Tgt) -> SimpleVectorData<'target, Tgt>where
Tgt: Target<'target>,
pub fn copy<'target, Tgt>(self, target: Tgt) -> SimpleVectorData<'target, Tgt>where
Tgt: Target<'target>,
Copy an existing SimpleVector.
Sourcepub fn data<'borrow>(&'borrow self) -> SimpleVectorAccessor<'borrow>
pub fn data<'borrow>(&'borrow self) -> SimpleVectorAccessor<'borrow>
Immutably access the contents of this SimpleVector.
Sourcepub unsafe fn typed_data_unchecked<'borrow, U>(
&'borrow self,
) -> SimpleVectorAccessor<'borrow, U>where
U: Managed<'borrow, 'static>,
pub unsafe fn typed_data_unchecked<'borrow, U>(
&'borrow self,
) -> SimpleVectorAccessor<'borrow, U>where
U: Managed<'borrow, 'static>,
Access the contents of this SimpleVector as U.
Safety: this method doesn’t check if U is correct for all elements.
Trait Implementations§
Source§impl<'scope, 'data> AsTyped<'scope, 'data> for SimpleVector<'scope>
impl<'scope, 'data> AsTyped<'scope, 'data> for SimpleVector<'scope>
fn as_typed(self) -> JlrsResult<TypedValue<'scope, 'data, Self>>
Source§impl<'scope> CCallArg for SimpleVector<'scope>
impl<'scope> CCallArg for SimpleVector<'scope>
Source§type CCallArgType = Value<'scope, 'static>
type CCallArgType = Value<'scope, 'static>
Type constructor for the type taken by the generated Julia function.
Source§type FunctionArgType = SimpleVector<'scope>
type FunctionArgType = SimpleVector<'scope>
Type constructor for the type taken by the
ccalled function.Source§impl<'scope> Clone for SimpleVector<'scope>
impl<'scope> Clone for SimpleVector<'scope>
Source§fn clone(&self) -> SimpleVector<'scope>
fn clone(&self) -> SimpleVector<'scope>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstructType for SimpleVector<'_>
impl ConstructType for SimpleVector<'_>
Source§type Static = SimpleVector<'static>
type Static = SimpleVector<'static>
Self, but with all lifetimes set to 'static. This ensures Self::Static has a type
id.Source§fn construct_type_uncached<'target, 'current, 'borrow, Tgt>(
target: Tgt,
) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
fn construct_type_uncached<'target, 'current, 'borrow, Tgt>(
target: Tgt,
) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
Constructs the type object associated with this type.
Source§fn construct_type_with_env_uncached<'target, Tgt>(
target: Tgt,
_env: &TypeVarEnv<'_>,
) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
fn construct_type_with_env_uncached<'target, Tgt>(
target: Tgt,
_env: &TypeVarEnv<'_>,
) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
Constructs the type object associated with this type. Read more
Source§fn base_type<'target, Tgt>(_target: &Tgt) -> Option<Value<'target, 'static>>where
Tgt: Target<'target>,
fn base_type<'target, Tgt>(_target: &Tgt) -> Option<Value<'target, 'static>>where
Tgt: Target<'target>,
Returns the base type object associated with this type. Read more
Source§fn construct_type<'target, Tgt>(target: Tgt) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
fn construct_type<'target, Tgt>(target: Tgt) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
Construct the type object and try to cache the result. If a cached entry is available, it
is returned.
Source§fn construct_type_with_env<'target, Tgt>(
target: Tgt,
env: &TypeVarEnv<'_>,
) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
fn construct_type_with_env<'target, Tgt>(
target: Tgt,
env: &TypeVarEnv<'_>,
) -> ValueData<'target, 'static, Tgt>where
Tgt: Target<'target>,
Construct the type object with an environment of
TypeVars and try to cache the result.
If a cached entry is available, it is returned. Read moreimpl<'scope> Copy for SimpleVector<'scope>
Source§impl<'scope> Debug for SimpleVector<'scope>
impl<'scope> Debug for SimpleVector<'scope>
Auto Trait Implementations§
impl<'scope> !Send for SimpleVector<'scope>
impl<'scope> !Sync for SimpleVector<'scope>
impl<'scope> Freeze for SimpleVector<'scope>
impl<'scope> RefUnwindSafe for SimpleVector<'scope>
impl<'scope> Unpin for SimpleVector<'scope>
impl<'scope> UnsafeUnpin for SimpleVector<'scope>
impl<'scope> UnwindSafe for SimpleVector<'scope>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'scope, 'data, W> Managed<'scope, 'data> for Wwhere
W: ManagedPriv<'scope, 'data>,
impl<'scope, 'data, W> Managed<'scope, 'data> for Wwhere
W: ManagedPriv<'scope, 'data>,
Source§type InScope<'target> = <W as ManagedPriv<'scope, 'data>>::WithLifetimes<'target, 'data>
type InScope<'target> = <W as ManagedPriv<'scope, 'data>>::WithLifetimes<'target, 'data>
Self, but with an arbitrary 'target lifetime instead of 'scope.Source§type WithData<'da> = <W as ManagedPriv<'scope, 'data>>::WithLifetimes<'scope, 'da>
type WithData<'da> = <W as ManagedPriv<'scope, 'data>>::WithLifetimes<'scope, 'da>
Self, but with an arbitrary 'da lifetime instead of 'data.Source§fn as_ref(self) -> Weak<'scope, 'data, Self>
fn as_ref(self) -> Weak<'scope, 'data, Self>
👎Deprecated:
use Managed::as_weak instead
Convert
self to a Weak. Deprecated, use Managed::as_weak instead of this method.Source§fn root<'target, Tgt>(
self,
target: Tgt,
) -> Tgt::Data<'data, Self::InScope<'target>>where
Tgt: Target<'target>,
fn root<'target, Tgt>(
self,
target: Tgt,
) -> Tgt::Data<'data, Self::InScope<'target>>where
Tgt: Target<'target>,
Use the target to reroot
self.Source§fn unrooted_target(self) -> Unrooted<'scope>
fn unrooted_target(self) -> Unrooted<'scope>
Returns a new
Unrooted.Source§fn display_string(self) -> JlrsResult<String>
fn display_string(self) -> JlrsResult<String>
Convert
self to its display string, i.e. the string that is shown when calling
Base.show.Source§fn error_string(self) -> JlrsResult<String>
fn error_string(self) -> JlrsResult<String>
Convert
self to its error string, i.e. the string that is shown when calling
Base.showerror. This string can contain ANSI color codes if this is enabled by calling
Runtime::error_color.Source§fn display_string_or<S: Into<String>>(self, default: S) -> String
fn display_string_or<S: Into<String>>(self, default: S) -> String
Convert
self to its display string, i.e. the string that is shown by calling
Base.display, or some default value.