[][src]Enum ocaml::Error

pub enum Error {
    NotCallable,
    NotDoubleArray,
    Message(&'static str),
    Error(Box<dyn Error>),
    Caml(CamlError),
}

Error returned by ocaml-rs functions

Variants

NotCallable

A value cannot be called using callback functions

NotDoubleArray

Array is not a double array

Message(&'static str)

Error message

Error(Box<dyn Error>)

General error

Caml(CamlError)

OCaml exceptions

Implementations

impl Error[src]

pub fn reraise(exc: Value) -> Result<(), Error>[src]

Re-raise an existing exception value

pub fn raise<S: AsRef<str>>(exc: S) -> Result<(), Error>[src]

Raise an exception that has been registered using Callback.register_exception with no arguments

pub fn raise_with_arg<S: AsRef<str>, T: ToValue>(
    exc: S,
    arg: T
) -> Result<(), Error>
[src]

Raise an exception that has been registered using Callback.register_exception with an argument

pub fn not_found() -> Result<(), Error>[src]

Raise Not_found

pub fn out_of_memory() -> Result<(), Error>[src]

Raise Out_of_memory

pub fn failwith(s: &'static str) -> Result<(), Error>[src]

Raise Failure

pub fn invalid_argument(s: &'static str) -> Result<(), Error>[src]

Raise Invalid_argument

pub fn named<S: AsRef<str>>(s: S) -> Option<Value>[src]

Get named error registered using Callback.register_exception

Trait Implementations

impl Debug for Error[src]

impl From<CamlError> for Error[src]

impl<T: 'static + Error> From<T> for Error[src]

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl !Send for Error

impl !Sync for Error

impl Unpin for Error

impl !UnwindSafe for Error

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<!> for T[src]

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

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

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.