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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
    D: ResourceDialect,
 
impl<T, D> Encode<Ambiguous1, D> for Twhere
    D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
    D: ResourceDialect,
 
impl<T, D> Encode<Ambiguous2, D> for Twhere
    D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
 
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
 
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type 
T to [Self]Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more