pub struct MockRealmQueryBuilder { /* private fields */ }
Expand description
Builder struct for RealmQueryResult
/
This is an builder interface meant to simplify building of test fixtures.
Example usage:
MockRealmQuery.add()
.when("other/component") // when client queries for this string ("other/component").
.moniker("./other/component") // Returns the following.
.exposes(vec![Expose::Protocol(ExposeProtocol {
source: Some(Ref::Self_(SelfRef)),
target: Some(Ref::Self_(SelfRef)),
source_name: Some("src".to_owned()),
target_name: Some("fuchsia.io.SomeOtherThing".to_owned()),
..Default::default()
})])
.add() // Finish building the result.
.when("some/thing") // Start another build.
...
Implementations§
source§impl MockRealmQueryBuilder
impl MockRealmQueryBuilder
sourcepub fn when(self, at: &str) -> MockRealmQueryBuilderInner
pub fn when(self, at: &str) -> MockRealmQueryBuilderInner
Start a build of RealmQueryResult
by specifying the
expected query string.
sourcepub fn build(self) -> MockRealmQuery
pub fn build(self) -> MockRealmQuery
Finish the build and return servable MockRealmQuery
.
Auto Trait Implementations§
impl Freeze for MockRealmQueryBuilder
impl RefUnwindSafe for MockRealmQueryBuilder
impl Send for MockRealmQueryBuilder
impl Sync for MockRealmQueryBuilder
impl Unpin for MockRealmQueryBuilder
impl UnwindSafe for MockRealmQueryBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more