[][src]Struct ocaml::List

#[repr(transparent)]pub struct List<T: ToValue + FromValue>(_, _);

List<A> wraps an OCaml 'a list without converting it to Rust, this introduces no additional overhead compared to a Value type

Implementations

impl<T: ToValue + FromValue> List<T>[src]

pub fn empty() -> List<T>[src]

An empty list

pub fn len(&self) -> usize[src]

Returns the number of items in self

pub fn is_empty(&self) -> bool[src]

Returns true when the list is empty

#[must_use]pub fn add(self, v: T) -> List<T>[src]

Add an element to the front of the list returning the new list

pub fn hd(&self) -> Option<T>[src]

List head

pub fn tl(&self) -> List<T>[src]

List tail

pub fn to_vec(&self) -> Vec<T>[src]

List as Vec

pub fn to_linked_list(&self) -> LinkedList<T>[src]

List as LinkedList

Trait Implementations

impl<T: Clone + ToValue + FromValue> Clone for List<T>[src]

impl<T: Copy + ToValue + FromValue> Copy for List<T>[src]

impl<T: ToValue + FromValue> FromValue for List<T>[src]

impl<T: PartialEq + ToValue + FromValue> PartialEq<List<T>> for List<T>[src]

impl<T: ToValue + FromValue> StructuralPartialEq for List<T>[src]

impl<T: ToValue + FromValue> ToValue for List<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for List<T> where
    T: RefUnwindSafe

impl<T> Send for List<T> where
    T: Send

impl<T> Sync for List<T> where
    T: Sync

impl<T> Unpin for List<T> where
    T: Unpin

impl<T> UnwindSafe for List<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.