Skip to main content

A

Struct A 

Source
pub struct A<'a, X> {
    pub ptr: NonNull<X>,
    pub L: u32,
    pub own: bool,
    pub Rev: bool,
    /* private fields */
}
Expand description

a static length, copy-on-write vector type with element type X

Fields§

§ptr: NonNull<X>

ptr to the buffer of elements

§L: u32

vector length

§own: bool

do we own this buffer?

§Rev: bool

is this buffer reversed?

Implementations§

Source§

impl<'a, X> A<'a, X>

Source

pub fn empty(len: usize) -> A<'a, X>

allocate an empty buffer of X. not really useful by itself.

Source

pub fn from_ptr(ptr: NonNull<X>, L: u32, Rev: bool) -> A<'a, X>

make a non-owned A from a ptr with length L

Source

pub unsafe fn ptr_add(&self, i: usize) -> *mut X

add i to the buffer ptr

Source

pub unsafe fn ptr_add_NN(&self, i: usize) -> NonNull<X>

add i to the buffer ptr and make it NonNull

Source

pub fn len(&self) -> usize

Source

pub fn rev<'b>(&'b self) -> A<'a, X>
where 'b: 'a,

return the vector with the reverse flag set

Source

pub fn rev_mut(&mut self)

reverse in place

Source

pub fn mkref<'b>(&'b self) -> A<'a, X>
where 'b: 'a,

Source

pub unsafe fn set_nocpy(&mut self, i: usize, x: X)

set a value in the buffer. THIS WRevITE DOES NOT COPY.

this function is only safe to use if you know that the buffer is owned (ie you just allocated it with empty). otherwise, the change will be propagated to all As that have ever been derived from this same buffer.

Source

pub unsafe fn at_nochk(&self, i: usize) -> X

get a value from the buffer without checking the boundary.

Source

pub fn drop<'b>(&'b self, n: u32) -> A<'a, X>
where 'b: 'a,

drop elements from the beginning of a vector

Source

pub fn cutC<'b>(&'b self, w: u32) -> A<'a, A<'a, X>>
where 'b: 'a,

cut an A into a matrix by columns (vertically).

Source§

impl<'a, X> A<'a, X>
where X: Copy + Into<usize>, usize: Into<X>,

Source

pub fn iota(x: X) -> A<'a, X>

Trait Implementations§

Source§

impl<'a, X> Clone for A<'a, X>

Source§

fn clone(&self) -> Self

clone() on A is actually a copy/ref

1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, X: Debug> Debug for A<'a, X>

Source§

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

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

impl<'a, X> Display for A<'a, X>
where X: Display,

Source§

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

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

impl<'a, X> Drop for A<'a, X>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a, X> Index<usize> for A<'a, X>

Source§

type Output = X

The returned type after indexing.
Source§

fn index(&self, idx: usize) -> &'a Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, X> Into<A<'a, X>> for Vec<X>

Source§

fn into(self) -> A<'a, X>

Converts this type into the (usually inferred) input type.
Source§

impl<'a, X> PartialEq for A<'a, X>
where X: PartialEq,

Source§

fn eq(&self, y: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<'a, X> !Send for A<'a, X>

§

impl<'a, X> !Sync for A<'a, X>

§

impl<'a, X> Freeze for A<'a, X>

§

impl<'a, X> RefUnwindSafe for A<'a, X>
where X: RefUnwindSafe,

§

impl<'a, X> Unpin for A<'a, X>

§

impl<'a, X> UnsafeUnpin for A<'a, X>

§

impl<'a, X> UnwindSafe for A<'a, X>
where X: RefUnwindSafe,

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<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.