pub struct FakeController { /* private fields */ }
Expand description

Test fake that allows configuring how to respond to fuchsia.fuzzer.Controller methods.

These fields are Rc<RefCell<_>> in order to be cloned and shared with the Task serving the controller. Unit tests can use this object to query values passed in FIDL requests and set values returned by FIDL responses.

Implementations§

source§

impl FakeController

source

pub fn new() -> Self

Creates a fake fuzzer that can serve fuchsia.fuzzer.Controller.

source

pub fn set_output(&self, output: TestOutput, socket: Socket) -> Status

Simulates a call to fuchsia.fuzzer.Manager/GetOutput without a fuzz-manager.

source

pub fn get_corpus_type(&self) -> Corpus

Returns the type of corpus received via FIDL requests.

source

pub fn set_corpus_type(&self, corpus_type: Corpus)

Sets the type of corpus to return via FIDL responses.

source

pub fn take_input_to_send(&self) -> Option<Vec<u8>>

Returns the test input to be sent via a FIDL response.

source

pub fn set_input_to_send(&self, input_to_send: &[u8])

Sets the test input to be sent via a FIDL response.

source

pub fn get_options(&self) -> Options

Returns the options received via FIDL requests.

source

pub fn set_options(&self, options: Options)

Sets the options to return via FIDL responses.

source

pub fn get_received_input(&self) -> Vec<u8>

Returns the test input received via FIDL requests.

source

pub fn get_result(&self) -> Result<FuzzResult, Status>

Returns the fuzzing result to be sent via a FIDL response.

source

pub fn set_result(&self, result: Result<FuzzResult, Status>)

Sets the fuzzing result to be sent via a FIDL response.

source

pub fn get_status(&self) -> Status

Gets the fuzzer status to be sent via FIDL responses.

source

pub fn set_status(&self, status: Status)

Sets the fuzzer status to be sent via FIDL responses.

source

pub fn cancel(&self)

Simulates a long-running workflow being canceled by fuchsia.fuzzer.Manager/Stop.

source

pub fn is_canceled(&self) -> bool

Get whether a simulated call to fuchsia.fuzzer.Manager/Stop has been made.

Trait Implementations§

source§

impl Clone for FakeController

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FakeController

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Encode<Ambiguous1> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> Encode<Ambiguous2> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more