Skip to main content

SimpleVector

Struct SimpleVector 

Source
pub struct SimpleVector<'scope>(/* private fields */);
Expand description

A SimpleVector is a fixed-size array that contains WeakValues.

Implementations§

Source§

impl<'scope> SimpleVector<'scope>

Source

pub fn new<'elem, Tgt, T>( target: Tgt, elems: &[T], ) -> SimpleVectorData<'scope, Tgt>
where Tgt: Target<'scope>, T: Managed<'elem, 'static>,

Create a new SimpleVector that contains every element in elems.

Source

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.

Source

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.

Source

pub fn copy<'target, Tgt>(self, target: Tgt) -> SimpleVectorData<'target, Tgt>
where Tgt: Target<'target>,

Copy an existing SimpleVector.

Source

pub fn data<'borrow>(&'borrow self) -> SimpleVectorAccessor<'borrow>

Immutably access the contents of this SimpleVector.

Source

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.

Source

pub fn len(&self) -> usize

Returns the length of this SimpleVector.

Source§

impl<'base> SimpleVector<'base>

Source

pub fn emptysvec<Tgt: Target<'base>>(_: &Tgt) -> Self

The empty SimpleVector.

Trait Implementations§

Source§

impl<'scope, 'data> AsTyped<'scope, 'data> for SimpleVector<'scope>

Source§

fn as_typed(self) -> JlrsResult<TypedValue<'scope, 'data, Self>>

Source§

impl<'scope> CCallArg for SimpleVector<'scope>

Source§

type CCallArgType = Value<'scope, 'static>

Type constructor for the type taken by the generated Julia function.
Source§

type FunctionArgType = SimpleVector<'scope>

Type constructor for the type taken by the ccalled function.
Source§

impl<'scope> Clone for SimpleVector<'scope>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl ConstructType for SimpleVector<'_>

Source§

const CACHEABLE: bool = false

Indicates whether the type might be cacheable. Read more
Source§

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>,

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>,

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>,

Returns the base type object associated with this type. Read more
Source§

fn type_id() -> TypeId

Returns the TypeId of Self::Static.
Source§

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>,

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 more
Source§

impl<'scope> Copy for SimpleVector<'scope>

Source§

impl<'scope> Debug for SimpleVector<'scope>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl<'scope> Typecheck for SimpleVector<'scope>

Source§

fn typecheck(t: DataType<'_>) -> bool

Returns whether the property implied by Self holds true.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'scope, 'data, W> Managed<'scope, 'data> for W
where W: ManagedPriv<'scope, 'data>,

Source§

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>

Self, but with an arbitrary 'da lifetime instead of 'data.
Source§

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 as_weak(self) -> Weak<'scope, 'data, Self>

Convert self to a Weak.
Source§

fn as_value(self) -> Value<'scope, 'data>

Convert self to a Value.
Source§

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>

Returns a new Unrooted.
Source§

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>

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

Convert self to its display string, i.e. the string that is shown by calling Base.display, or some default value.
Source§

fn error_string_or<S: Into<String>>(self, default: S) -> String

Convert self to its error string, i.e. the string that is shown when this value is thrown as an exception, or some default value.
Source§

fn leak(self) -> Weak<'static, 'data, Self::InScope<'static>>

Extends the 'scope lifetime to 'static and converts it to a Weak, which allows this managed data to be leaked from a scope. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.