mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
cros_async: Deref U64Source to the inner source
Allow U64Source to Deref to the inner u64 producer. The first user will be asynchronous timers that that need to rearm the inner timer. Change-Id: If23b7a03df5ef407ae7a0c1fdc76d460e628727b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2299842 Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Dylan Reid <dgreid@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
This commit is contained in:
parent
a70743b271
commit
fc5220e4df
1 changed files with 13 additions and 0 deletions
|
@ -267,6 +267,19 @@ impl<F: AsRawFd + Unpin> U64Source<F> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<F: AsRawFd + Unpin> std::ops::Deref for U64Source<F> {
|
||||
type Target = F;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.inner
|
||||
}
|
||||
}
|
||||
|
||||
impl<F: AsRawFd + Unpin> std::ops::DerefMut for U64Source<F> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.inner
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::fs::{File, OpenOptions};
|
||||
|
|
Loading…
Reference in a new issue