pub struct MockCoordinator { /* private fields */ }Expand description
MockCoordinator implements the server-end of the fuchsia.hardware.display.Coordinator
protocol. It minimally reproduces the display coordinator driver state machine to respond to
FIDL messages in a predictable and configurable manner.
Implementations§
Source§impl MockCoordinator
impl MockCoordinator
Sourcepub fn new(
coordinator_server_end: ServerEnd<CoordinatorMarker>,
listener_client_end: ClientEnd<CoordinatorListenerMarker>,
) -> Result<MockCoordinator>
pub fn new( coordinator_server_end: ServerEnd<CoordinatorMarker>, listener_client_end: ClientEnd<CoordinatorListenerMarker>, ) -> Result<MockCoordinator>
Bind a new MockCoordinator to the server end of a FIDL channel.
Sourcepub fn assign_displays(&mut self, displays: Vec<Info>) -> Result<()>
pub fn assign_displays(&mut self, displays: Vec<Info>) -> Result<()>
Replace the list of available display devices with the given collection and send a
fuchsia.hardware.display.Coordinator.OnDisplaysChanged event reflecting the changes.
All the new displays will be reported as added while previously present displays will be reported as removed, regardless of their content.
Returns an error if displays contains entries with repeated display IDs.
Sourcepub fn emit_vsync_event(
&self,
display_id_value: u64,
stamp: ConfigStamp,
) -> Result<()>
pub fn emit_vsync_event( &self, display_id_value: u64, stamp: ConfigStamp, ) -> Result<()>
Sends a single OnVsync event to the client. The vsync event will appear to be sent from the
given display_id even if a corresponding fake display has not been assigned by a call to
assign_displays.
Auto Trait Implementations§
impl Freeze for MockCoordinator
impl !RefUnwindSafe for MockCoordinator
impl Send for MockCoordinator
impl Sync for MockCoordinator
impl Unpin for MockCoordinator
impl !UnwindSafe for MockCoordinator
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
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,
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>
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>
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