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
.
pub fn prefilled() -> Self
Trait Implementations§
Source§impl Default for MockRealmQueryBuilder
impl Default for MockRealmQueryBuilder
Source§fn default() -> MockRealmQueryBuilder
fn default() -> MockRealmQueryBuilder
Returns the “default value” for a type. Read more
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