Struct go_vm::types::SliceObj

source ·
pub struct SliceObj<T> { /* private fields */ }

Implementations§

source§

impl<T> SliceObj<T>where T: Element,

source

pub fn with_array( arr: GosValue, begin: isize, end: isize ) -> RuntimeResult<SliceObj<T>>

source

pub fn array(&self) -> &GosValue

Get a reference to the slice obj’s array.

source

pub fn array_obj(&self) -> &ArrayObj<T>

source

pub fn begin(&self) -> usize

source

pub fn end(&self) -> usize

source

pub fn len(&self) -> usize

source

pub fn cap(&self) -> usize

source

pub fn range(&self) -> Range<usize>

source

pub fn as_rust_slice(&self) -> Ref<'_, [T]>

source

pub fn as_rust_slice_mut(&self) -> RefMut<'_, [T]>

source

pub fn sharing_with(&self, other: &SliceObj<T>) -> bool

source

pub fn get_array_equivalent(&self, i: usize) -> (&GosValue, usize)

get_array_equivalent returns the underlying array and mapped index

source

pub fn index_elem(&self, i: usize) -> T

source

pub fn get(&self, i: usize, t: ValueType) -> RuntimeResult<GosValue>

source

pub fn set(&self, i: usize, val: &GosValue) -> RuntimeResult<()>

source

pub fn push(&mut self, val: GosValue)

source

pub fn append(&mut self, other: &SliceObj<T>)

source

pub fn copy_from(&self, other: &SliceObj<T>) -> usize

source

pub fn slice( &self, begin: isize, end: isize, max: isize ) -> RuntimeResult<SliceObj<T>>

source

pub fn swap(&self, i: usize, j: usize) -> RuntimeResult<()>

source§

impl<T> SliceObj<CellElem<T>>where T: CellData,

source

pub fn as_raw_slice<U>(&self) -> Ref<'_, [U]>

source

pub fn as_raw_slice_mut<U>(&self) -> RefMut<'_, [U]>

source§

impl SliceObj<CellElem<u8>>

Trait Implementations§

source§

impl<T: Clone> Clone for SliceObj<T>

source§

fn clone(&self) -> SliceObj<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T> PartialEq<SliceObj<T>> for SliceObj<T>

source§

fn eq(&self, _other: &SliceObj<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Eq for SliceObj<T>

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for SliceObj<T>

§

impl<T> !Send for SliceObj<T>

§

impl<T> !Sync for SliceObj<T>

§

impl<T> Unpin for SliceObj<T>where T: Unpin,

§

impl<T> !UnwindSafe for SliceObj<T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.