WhileyTestFile

Struct WhileyTestFile 

Source
pub struct WhileyTestFile<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> WhileyTestFile<'a>

Source

pub fn new(input: &'a str) -> Result<WhileyTestFile<'a>>

Source

pub fn get(&self, key: &str) -> Option<&Value<'_>>

Get configuration option associated with the given key.

Source

pub fn size(&self) -> usize

Get number of frames in this test file.

Source

pub fn frame(&self, n: usize) -> &Frame<'_>

Get nth frame within this test file.

Source

pub fn get_int(&self, key: &str) -> Option<i64>

Get configuration option which is expected to be an integer. If its not an integer, or no such key exists, None is returned.

Source

pub fn get_bool(&self, key: &str) -> Option<bool>

Get configuration option which is expected to be an boolean. If its not a boolean, or no such key exists, None is returned.

Source

pub fn get_str(&self, key: &str) -> Option<&'a str>

Get configuration option which is expected to be a string If its not a string, or no such key exists, None is returned.

Source

pub fn iter<'b>(&'b self) -> Iter<'b, Frame<'_>>

Obtain an iterator to the frames of this test file.

Auto Trait Implementations§

§

impl<'a> Freeze for WhileyTestFile<'a>

§

impl<'a> RefUnwindSafe for WhileyTestFile<'a>

§

impl<'a> Send for WhileyTestFile<'a>

§

impl<'a> Sync for WhileyTestFile<'a>

§

impl<'a> Unpin for WhileyTestFile<'a>

§

impl<'a> UnwindSafe for WhileyTestFile<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.