[−][src]Struct ocaml::List
List<A>
wraps an OCaml 'a list
without converting it to Rust, this introduces no
additional overhead compared to a Value
type
Methods
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]
fn from_value(value: Value) -> Self
[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,
T: RefUnwindSafe,
impl<T> Send for List<T> where
T: Send,
T: Send,
impl<T> Sync for List<T> where
T: Sync,
T: Sync,
impl<T> Unpin for List<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for List<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,