[][src]Struct artichoke::prelude::Interrupt

pub struct Interrupt { /* fields omitted */ }

Ruby Interrupt error type.

Descendants of class Exception are used to communicate between Kernel#raise and rescue statements in begin ... end blocks. Exception objects carry information about the exception – its type (the exception's class name), an optional descriptive string, and optional traceback information. Exception subclasses may add additional information like NameError#name.

Implementations

impl Interrupt[src]

#[must_use]pub const fn new() -> Interrupt[src]

Construct a new, default Interrupt Ruby exception.

This constructor sets the exception message to Interrupt.

Examples

let exception = Interrupt::new();
assert_eq!(exception.message(), b"Interrupt");

#[must_use]pub fn message(&self) -> &[u8][src]

Return the message this Ruby exception was constructed with.

Examples

let exception = Interrupt::new();
assert_eq!(exception.message(), b"Interrupt");
let exception = Interrupt::from("something went wrong");
assert_eq!(exception.message(), b"something went wrong");

#[must_use]pub const fn name(&self) -> &'static str[src]

Return this Ruby exception's class name.

Examples

let exception = Interrupt::new();
assert_eq!(exception.name(), "Interrupt");

Trait Implementations

impl Clone for Interrupt[src]

impl Debug for Interrupt[src]

impl Default for Interrupt[src]

impl Display for Interrupt[src]

impl Eq for Interrupt[src]

impl Error for Interrupt[src]

impl From<&'static [u8]> for Interrupt[src]

impl From<&'static str> for Interrupt[src]

impl From<Cow<'static, [u8]>> for Interrupt[src]

impl From<Cow<'static, str>> for Interrupt[src]

impl From<Interrupt> for Error[src]

impl From<String> for Interrupt[src]

impl From<Vec<u8, Global>> for Interrupt[src]

impl Hash for Interrupt[src]

impl Ord for Interrupt[src]

impl PartialEq<Interrupt> for Interrupt[src]

impl PartialOrd<Interrupt> for Interrupt[src]

impl RubyException for Interrupt[src]

impl RubyException for Interrupt[src]

impl StructuralEq for Interrupt[src]

impl StructuralPartialEq for Interrupt[src]

Auto Trait Implementations

impl RefUnwindSafe for Interrupt

impl Send for Interrupt

impl Sync for Interrupt

impl Unpin for Interrupt

impl UnwindSafe for Interrupt

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]