[][src]Struct artichoke::prelude::RangeError

pub struct RangeError { /* fields omitted */ }

Ruby RangeError 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 RangeError[src]

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

Construct a new, default RangeError Ruby exception.

This constructor sets the exception message to RangeError.

Examples

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

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

Return the message this Ruby exception was constructed with.

Examples

let exception = RangeError::new();
assert_eq!(exception.message(), b"RangeError");
let exception = RangeError::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 = RangeError::new();
assert_eq!(exception.name(), "RangeError");

Trait Implementations

impl Clone for RangeError[src]

impl Debug for RangeError[src]

impl Default for RangeError[src]

impl Display for RangeError[src]

impl Eq for RangeError[src]

impl Error for RangeError[src]

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

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

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

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

impl From<RangeError> for Error[src]

impl From<String> for RangeError[src]

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

impl Hash for RangeError[src]

impl Ord for RangeError[src]

impl PartialEq<RangeError> for RangeError[src]

impl PartialOrd<RangeError> for RangeError[src]

impl RubyException for RangeError[src]

impl RubyException for RangeError[src]

impl StructuralEq for RangeError[src]

impl StructuralPartialEq for RangeError[src]

Auto Trait Implementations

impl RefUnwindSafe for RangeError

impl Send for RangeError

impl Sync for RangeError

impl Unpin for RangeError

impl UnwindSafe for RangeError

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]