pub struct EmbeddedLabServer { /* private fields */ }Expand description
Handle to the embedded fuchsia.driver.lab server running inside an
existing DFv2 driver.
Implementations§
Source§impl EmbeddedLabServer
impl EmbeddedLabServer
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether the embedded server is enabled.
Sourcepub fn publish(
&self,
outgoing: &mut ServiceFs<ServiceObj<'static, ()>>,
scope_handle: ScopeHandle,
)
pub fn publish( &self, outgoing: &mut ServiceFs<ServiceObj<'static, ()>>, scope_handle: ScopeHandle, )
Publishes fuchsia.driver.lab.Service (default instance) onto a
thread-safe driver [ServiceFs], spawning connection handlers onto
scope_handle.
When disabled (enable_driver_lab = false), this is a no-op and omits
outgoing service handlers (Spec Phase 2 Section 4.1).
Sourcepub fn publish_local(
&self,
outgoing: &mut ServiceFs<ServiceObjLocal<'static, ()>>,
scope_handle: ScopeHandle,
)
pub fn publish_local( &self, outgoing: &mut ServiceFs<ServiceObjLocal<'static, ()>>, scope_handle: ScopeHandle, )
Publishes fuchsia.driver.lab.Service (default instance) onto a
local driver [ServiceFs], spawning connection handlers onto
scope_handle.
When disabled (enable_driver_lab = false), this is a no-op and omits
outgoing service handlers (Spec Phase 2 Section 4.1).
Sourcepub fn serve_proxy_stream(
&self,
scope_handle: ScopeHandle,
stream: Proxy_RequestStream,
)
pub fn serve_proxy_stream( &self, scope_handle: ScopeHandle, stream: Proxy_RequestStream, )
Spawns a single fuchsia.driver.lab.Proxy stream on scope_handle.
Sourcepub fn serve_proxy_channel(&self, scope_handle: ScopeHandle, channel: Channel)
pub fn serve_proxy_channel(&self, scope_handle: ScopeHandle, channel: Channel)
Spawns a single fuchsia.driver.lab.Proxy channel server-end on scope_handle.
Sourcepub fn state(&self) -> &SharedState
pub fn state(&self) -> &SharedState
Returns a reference to the underlying shared proxy state.
Sourcepub fn is_quiesced(&self) -> bool
pub fn is_quiesced(&self) -> bool
Returns whether the driver is currently quiesced due to an active mutating session (lock-free atomic read).
Sourcepub fn quiesce_flag(&self) -> Arc<AtomicBool> ⓘ
pub fn quiesce_flag(&self) -> Arc<AtomicBool> ⓘ
Returns a cloneable handle to the atomic quiesce flag so driver background loops can check quiesce status without locking.
Sourcepub fn trace_counter(&self, resource_id: ResourceId, offset: u64, value: u32)
pub fn trace_counter(&self, resource_id: ResourceId, offset: u64, value: u32)
Samples the driver_lab trace counter for offset on
resource_id with value.
Successful host writes are sampled automatically. Call this when
the driver itself changes a register or knob that a host may also
write, so both sources share one counter track. No-op unless the
server is enabled and a trace session has enabled driver_lab.
Sourcepub fn notify_interrupt(
&self,
resource_id: ResourceId,
) -> Option<InterruptEvent>
pub fn notify_interrupt( &self, resource_id: ResourceId, ) -> Option<InterruptEvent>
Taps an interrupt event from the driver’s own interrupt service routine
(lab.notify_interrupt(resource_id)) without stealing or binding the
raw zx::Interrupt handle (Spec Phase 2 Section 2.3).
Increments the interrupt sequence and total count, appends to the audit
ring, and satisfies pending host WaitForInterrupt hanging gets.
Sourcepub fn notify_interrupt_with_timestamp(
&self,
resource_id: ResourceId,
timestamp_ns: i64,
) -> Option<InterruptEvent>
pub fn notify_interrupt_with_timestamp( &self, resource_id: ResourceId, timestamp_ns: i64, ) -> Option<InterruptEvent>
Taps an interrupt event with an explicit timestamp.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EmbeddedLabServer
impl RefUnwindSafe for EmbeddedLabServer
impl Send for EmbeddedLabServer
impl Sync for EmbeddedLabServer
impl Unpin for EmbeddedLabServer
impl UnsafeUnpin for EmbeddedLabServer
impl UnwindSafe for EmbeddedLabServer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§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
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
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