id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | // ===== process driver =====
cfg_process_driver! {
type ProcessDriver = crate::runtime::process::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
ProcessDriver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = Sign... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 58c457190b8a79b7ed8a76910e4d84d9d5de163d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/58c457190b8a79b7ed8a76910e4d84d9d5de163d/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | enable: bool,
io_stack: IoStack,
clock: Clock,
) -> (TimeDriver, TimeHandle) {
if enable {
let (driver, handle) = crate::runtime::time::Driver::new(io_stack, clock);
(TimeDriver::Enabled { driver }, Some(handle))
} else {
(TimeDriver::Disabled(io_... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 58c457190b8a79b7ed8a76910e4d84d9d5de163d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/58c457190b8a79b7ed8a76910e4d84d9d5de163d/tokio/src/runtime/driver.rs | 281 | 335 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:9 | pub(crate) type Clock = ();
pub(crate) type TimeHandle = ();
fn create_clock(_enable_pausing: bool, _start_paused: bool) -> Clock {
()
}
fn create_time_driver(
_enable: bool,
io_stack: IoStack,
_clock: Clock,
) -> (TimeDriver, TimeHandle) {
(io_stack, ())
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 58c457190b8a79b7ed8a76910e4d84d9d5de163d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/58c457190b8a79b7ed8a76910e4d84d9d5de163d/tokio/src/runtime/driver.rs | 321 | 335 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Handle)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.enable_io)?;
let clock = create_clock(cfg.enable_pause_time, cfg.start_paused);
let (time_driver, time_handle) =
create_time_driver(cfg.enabl... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | self.io.unpark();
}
cfg_time! {
/// Returns a reference to the time driver handle.
///
/// Panics if no time driver is present.
#[track_caller]
pub(crate) fn time(&self) -> &crate::runtime::time::Handle {
self.time
.as_ref()
.e... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | let (signal_driver, signal_handle) = create_signal_driver(io_driver)?;
let process_driver = create_process_driver(signal_driver);
(IoStack::Enabled(process_driver), IoHandle::Enabled(io_handle), signal_handle)
} else {
let park_thread = ParkThread::new();
let unp... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | IoHandle::Enabled(handle) => handle.unpark(),
IoHandle::Disabled(handle) => handle.unpark(),
}
}
#[track_caller]
pub(crate) fn expect(self, msg: &'static str) -> crate::runtime::io::Handle {
match self {
IoHandle::Enabled(v) => v,
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | pub(crate) fn park_timeout(&mut self, _handle: &Handle, duration: Duration) {
self.0.park_timeout(duration);
}
pub(crate) fn shutdown(&mut self, _handle: &Handle) {
self.0.shutdown();
}
}
}
// ===== signal driver =====
cfg_signal_internal_and_unix! {
type Signa... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | let (driver, handle) = crate::runtime::time::Driver::new(io_stack, clock);
(TimeDriver::Enabled { driver }, Some(handle))
} else {
(TimeDriver::Disabled(io_stack), None)
}
}
impl TimeDriver {
pub(crate) fn park(&mut self, handle: &Handle) {
match sel... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 281 | 330 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:9 | }
fn create_time_driver(
_enable: bool,
io_stack: IoStack,
_clock: Clock,
) -> (TimeDriver, TimeHandle) {
(io_stack, ())
}
} | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/runtime/driver.rs | 321 | 330 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | IoHandle::Enabled(handle) => handle.unpark(),
IoHandle::Disabled(handle) => handle.unpark(),
}
}
#[track_caller]
pub(crate) fn expect(self, msg: &'static str) -> crate::runtime::io::Handle {
match self {
IoHandle::Enabled(v) => v,
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | a03e0420249d1740668f608a5a16f1fa614be2c7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/a03e0420249d1740668f608a5a16f1fa614be2c7/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | pub(crate) fn park_timeout(&mut self, _handle: &Handle, duration: Duration) {
self.0.park_timeout(duration);
}
pub(crate) fn shutdown(&mut self, _handle: &Handle) {
self.0.shutdown();
}
}
}
// ===== signal driver =====
macro_rules! cfg_signal_internal_and_unix {
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | a03e0420249d1740668f608a5a16f1fa614be2c7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/a03e0420249d1740668f608a5a16f1fa614be2c7/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | }
}
// ===== process driver =====
cfg_process_driver! {
type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | a03e0420249d1740668f608a5a16f1fa614be2c7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/a03e0420249d1740668f608a5a16f1fa614be2c7/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Handle)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.enable_io)?;
let clock = create_clock(cfg.enable_pause_time, cfg.start_paused);
let (time_driver, time_handle) =
create_time_driver(cfg.enabl... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | self.io.unpark();
}
}
// ===== io driver =====
cfg_io_driver! {
pub(crate) type IoDriver = crate::runtime::io::Driver;
#[derive(Debug)]
pub(crate) enum IoStack {
Enabled(ProcessDriver),
Disabled(ParkThread),
}
#[derive(Debug, Clone)]
pub(crate) enum IoHandle {
Ena... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | }
impl IoStack {
/*
pub(crate) fn handle(&self) -> IoHandle {
match self {
IoStack::Enabled(v) => IoHandle::Enabled(v.handle()),
IoStack::Disabled(v) => IoHandle::Disabled(v.unpark()),
}
}]
*/
pub(crate) fn park(&mut s... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | }
#[track_caller]
pub(crate) fn expect(self, msg: &'static str) -> crate::runtime::io::Handle {
match self {
IoHandle::Enabled(v) => v,
IoHandle::Disabled(..) => panic!("{}", msg),
}
}
cfg_unstable! {
pub(crate) fn as_... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | cfg_signal_internal_and_unix! {
type SignalDriver = crate::signal::unix::driver::Driver;
pub(crate) type SignalHandle = Option<crate::signal::unix::driver::Handle>;
fn create_signal_driver(io_driver: IoDriver) -> io::Result<(SignalDriver, SignalHandle)> {
let driver = crate::signal::unix::driver::D... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | }
}
}
// ===== time driver =====
cfg_time! {
#[derive(Debug)]
pub(crate) enum TimeDriver {
Enabled {
driver: crate::runtime::time::Driver,
handle: crate::runtime::time::Handle,
},
Disabled(IoStack),
}
pub(crate) type Clock = crate::time::Clock;
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | TimeDriver::Enabled { driver, handle } => driver.park(handle),
TimeDriver::Disabled(v) => v.park(),
}
}
pub(crate) fn park_timeout(&mut self, duration: Duration) {
match self {
TimeDriver::Enabled { driver, handle } => driver.park_timeout(handle, ... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 0b92f80a6506c6a89eb998e5f61a33415353bba1 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0b92f80a6506c6a89eb998e5f61a33415353bba1/tokio/src/runtime/driver.rs | 281 | 319 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
// Eventually, this file will see significant refactoring / cleanup. For now, we
// don't need to worry much about dead code with certain feature permutations.
#![cfg_attr(not(feature = "full"), allow(dead_code))]
use crate::park::thread::{P... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | pub(crate) type Unpark = TimerUnpark;
impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Handle)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.enable_io)?;
let clock = create_clock(cfg.enable_pause_time, cfg.start_paused);
let (time_driver, time_handle) =
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | cfg_io_driver! {
pub(crate) type IoDriver = crate::runtime::io::Driver;
pub(crate) type IoHandle = IoUnpark;
#[derive(Debug)]
pub(crate) enum IoStack {
Enabled(ProcessDriver),
Disabled(ParkThread),
}
#[derive(Debug, Clone)]
pub(crate) enum IoUnpark {
Enabled(crate::... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | match self {
IoStack::Enabled(v) => IoUnpark::Enabled(v.unpark()),
IoStack::Disabled(v) => IoUnpark::Disabled(v.unpark()),
}
}
pub(crate) fn park(&mut self) {
match self {
IoStack::Enabled(v) => v.park(),
IoStack::D... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | IoUnpark::Disabled(..) => panic!("{}", msg),
}
}
cfg_unstable! {
pub(crate) fn as_ref(&self) -> Option<&crate::runtime::io::Handle> {
match self {
IoUnpark::Enabled(v) => Some(v),
IoUnpark::Disabled(..) => None,
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | fn create_signal_driver(io_driver: IoDriver) -> io::Result<(SignalDriver, SignalHandle)> {
let driver = crate::signal::unix::driver::Driver::new(io_driver)?;
let handle = driver.handle();
Ok((driver, Some(handle)))
}
}
cfg_not_signal_internal! {
pub(crate) type SignalHandle = ();
c... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | cfg_time! {
#[derive(Debug)]
pub(crate) enum TimeDriver {
Enabled {
driver: crate::runtime::time::Driver,
handle: crate::runtime::time::Handle,
},
Disabled(IoStack),
}
pub(crate) enum TimerUnpark {
Enabled(crate::runtime::time::TimerUnpark),
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | TimeDriver::Enabled { driver, .. } => TimerUnpark::Enabled(driver.unpark()),
TimeDriver::Disabled(v) => TimerUnpark::Disabled(v.unpark()),
}
}
pub(crate) fn park(&mut self) {
match self {
TimeDriver::Enabled { driver, handle } => driver.park(handl... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 9e0275977981356fc5618b2061cdac8eb39a9569 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/9e0275977981356fc5618b2061cdac8eb39a9569/tokio/src/runtime/driver.rs | 281 | 336 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
// Eventually, this file will see significant refactoring / cleanup. For now, we
// don't need to worry much about dead code with certain feature permutations.
#![cfg_attr(not(feature = "full"), allow(dead_code))]
use crate::park::thread::{P... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | (IoStack::Enabled(process_driver), IoUnpark::Enabled(io_handle), signal_handle)
} else {
let park_thread = ParkThread::new();
let unpark_thread = park_thread.unpark();
(IoStack::Disabled(park_thread), IoUnpark::Disabled(unpark_thread), Default::default())
};
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | impl IoUnpark {
pub(crate) fn unpark(&self) {
match self {
IoUnpark::Enabled(v) => v.unpark(),
IoUnpark::Disabled(v) => v.unpark(),
}
}
#[track_caller]
pub(crate) fn expect(self, msg: &'static str) -> crate::runtime::io::Handle {
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | macro_rules! cfg_signal_internal_and_unix {
($($item:item)*) => {
#[cfg(unix)]
cfg_signal_internal! { $($item)* }
}
}
cfg_signal_internal_and_unix! {
type SignalDriver = crate::signal::unix::driver::Driver;
pub(crate) type SignalHandle = Option<crate::signal::unix::driver::Handle>;
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
signal_driver
}
}
}
// ===== time driver =====
cfg_time! {
#[derive(Debug)]
pub(crate) enum TimeDriver {
E... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | if enable {
let (driver, handle) = crate::runtime::time::Driver::new(io_stack, clock);
(TimeDriver::Enabled { driver, handle: handle.clone() }, Some(handle))
} else {
(TimeDriver::Disabled(io_stack), None)
}
}
impl TimeDriver {
pub(crate) fn unpark(&... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | pub(crate) fn unpark(&self) {
match self {
TimerUnpark::Enabled(v) => v.unpark(),
TimerUnpark::Disabled(v) => v.unpark(),
}
}
}
}
cfg_not_time! {
type TimeDriver = IoStack;
type TimerUnpark = IoUnpark;
pub(crate) type Clock = ();
pub(... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | pub(crate) signal_handle: SignalHandle,
pub(crate) time_handle: TimeHandle,
pub(crate) clock: Clock,
}
pub(crate) struct Cfg {
pub(crate) enable_io: bool,
pub(crate) enable_time: bool,
pub(crate) enable_pause_time: bool,
pub(crate) start_paused: bool,
}
impl Driver {
pub(crate) fn new(cfg:... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 98e642d23477d1af8d7a62d41d9907e567241a71 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/98e642d23477d1af8d7a62d41d9907e567241a71/tokio/src/runtime/driver.rs | 281 | 328 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | (IoStack::Enabled(process_driver), IoUnpark::Enabled(io_handle), signal_handle)
} else {
let park_thread = ParkThread::new();
let unpark_thread = park_thread.unpark();
(IoStack::Disabled(park_thread), IoUnpark::Disabled(unpark_thread), Default::default())
};
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | impl IoUnpark {
pub(crate) fn unpark(&self) {
match self {
IoUnpark::Enabled(v) => v.unpark(),
IoUnpark::Disabled(v) => v.unpark(),
}
}
#[track_caller]
pub(crate) fn expect(self, msg: &'static str) -> crate::runtime::io::Handle {
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | // ===== signal driver =====
macro_rules! cfg_signal_internal_and_unix {
($($item:item)*) => {
#[cfg(unix)]
cfg_signal_internal! { $($item)* }
}
}
cfg_signal_internal_and_unix! {
type SignalDriver = crate::signal::unix::driver::Driver;
pub(crate) type SignalHandle = Option<crate::signa... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | }
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
signal_driver
}
}
}
// ===== time driver =====
cfg_time! {
#[derive(Debug)]
pub(crate) enum TimeDriver {
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | ) -> (TimeDriver, TimeHandle) {
if enable {
let (driver, handle) = crate::runtime::time::Driver::new(io_stack, clock);
(TimeDriver::Enabled { driver, handle: handle.clone() }, Some(handle))
} else {
(TimeDriver::Disabled(io_stack), None)
}
}
impl Tim... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | }
}
impl Drop for TimeDriver {
fn drop(&mut self) {
if let TimeDriver::Enabled { driver, handle } = self {
driver.shutdown(handle);
}
}
}
impl TimerUnpark {
pub(crate) fn unpark(&self) {
match self {
TimerUnpar... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | // ===== runtime driver =====
#[derive(Debug)]
pub(crate) struct Driver {
inner: TimeDriver,
}
pub(crate) type Unpark = TimerUnpark;
pub(crate) struct Resources {
pub(crate) io_handle: IoHandle,
pub(crate) signal_handle: SignalHandle,
pub(crate) time_handle: TimeHandle,
pub(crate) clock: Clock,
}... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 281 | 340 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:9 | },
))
}
pub(crate) fn unpark(&self) -> TimerUnpark {
self.inner.unpark()
}
pub(crate) fn park(&mut self) {
self.inner.park()
}
pub(crate) fn park_timeout(&mut self, duration: Duration) {
self.inner.park_timeout(duration)
}
// TODO: tokio-rs/tokio#4990,... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 3f379abda4f980086ab44f4912eff877bdb75120 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f379abda4f980086ab44f4912eff877bdb75120/tokio/src/runtime/driver.rs | 321 | 343 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
// Eventually, this file will see significant refactoring / cleanup. For now, we
// don't need to worry much about dead code with certain feature permutations.
#![cfg_attr(not(feature = "rt"), allow(dead_code))]
use crate::park::thread::{Par... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | } else {
(IoStack::Disabled(ParkThread::new()), Default::default(), Default::default())
};
Ok(ret)
}
impl IoStack {
pub(crate) fn unpark(&self) -> IoUnpark {
match self {
IoStack::Enabled(v) => IoUnpark::Enabled(v.unpark()),
IoSta... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | match self {
IoUnpark::Enabled(v) => v.unpark(),
IoUnpark::Disabled(v) => v.unpark(),
}
}
}
}
cfg_not_io_driver! {
pub(crate) type IoHandle = ();
pub(crate) type IoStack = ParkThread;
pub(crate) type IoUnpark = UnparkThread;
fn create_io_stack(_e... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | cfg_io_driver! {
type SignalDriver = IoDriver;
fn create_signal_driver(io_driver: IoDriver) -> io::Result<(SignalDriver, SignalHandle)> {
Ok((io_driver, ()))
}
}
}
// ===== process driver =====
cfg_process_driver! {
type ProcessDriver = crate::process::unix::driver::Driver... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | }
pub(crate) enum TimerUnpark {
Enabled(crate::runtime::time::TimerUnpark),
Disabled(IoUnpark),
}
pub(crate) type Clock = crate::time::Clock;
pub(crate) type TimeHandle = Option<crate::runtime::time::Handle>;
fn create_clock(enable_pausing: bool, start_paused: bool) -> Clock {
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | }
}
pub(crate) fn park_timeout(&mut self, duration: Duration) {
match self {
TimeDriver::Enabled { driver, handle } => driver.park_timeout(handle, duration),
TimeDriver::Disabled(v) => v.park_timeout(duration),
}
}
// TODO: tokio-... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | type TimeDriver = IoStack;
type TimerUnpark = IoUnpark;
pub(crate) type Clock = ();
pub(crate) type TimeHandle = ();
fn create_clock(_enable_pausing: bool, _start_paused: bool) -> Clock {
()
}
fn create_time_driver(
_enable: bool,
io_stack: IoStack,
_clock: Clo... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | }
impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Resources)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.enable_io)?;
let clock = create_clock(cfg.enable_pause_time, cfg.start_paused);
let (time_driver, time_handle) =
create_time_driver(cfg... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 588408c06000313f7b4f31c225d3635e9b012e3f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/588408c06000313f7b4f31c225d3635e9b012e3f/tokio/src/runtime/driver.rs | 281 | 321 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::thread::{ParkThread, UnparkThread};
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
pub(crate) type IoDriver = crate::runtime::io::Driver;
pub(crate) type IoHandle = Option<crate::run... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | }
impl IoStack {
pub(crate) fn unpark(&self) -> IoUnpark {
match self {
IoStack::Enabled(v) => IoUnpark::Enabled(v.unpark()),
IoStack::Disabled(v) => IoUnpark::Disabled(v.unpark()),
}
}
pub(crate) fn park(&mut self) {
matc... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | }
}
cfg_not_io_driver! {
pub(crate) type IoHandle = ();
pub(crate) type IoStack = ParkThread;
pub(crate) type IoUnpark = UnparkThread;
fn create_io_stack(_enabled: bool) -> io::Result<(IoStack, IoHandle, SignalHandle)> {
Ok((ParkThread::new(), Default::default(), Default::default()))
}
}
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | Ok((io_driver, ()))
}
}
}
// ===== process driver =====
cfg_process_driver! {
type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_proce... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | }
pub(crate) type Clock = crate::time::Clock;
pub(crate) type TimeHandle = Option<crate::runtime::time::Handle>;
fn create_clock(enable_pausing: bool, start_paused: bool) -> Clock {
crate::time::Clock::new(enable_pausing, start_paused)
}
fn create_time_driver(
enable: bool,
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | TimeDriver::Enabled { driver, handle } => driver.park_timeout(handle, duration),
TimeDriver::Disabled(v) => v.park_timeout(duration),
}
}
// TODO: tokio-rs/tokio#4990, should the `current_thread` scheduler call this?
cfg_rt_multi_thread! {
pub(crate) fn s... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | fn create_clock(_enable_pausing: bool, _start_paused: bool) -> Clock {
()
}
fn create_time_driver(
_enable: bool,
io_stack: IoStack,
_clock: Clock,
) -> (TimeDriver, TimeHandle) {
(io_stack, ())
}
}
// ===== runtime driver =====
#[derive(Debug)]
pub(crate) stru... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | let clock = create_clock(cfg.enable_pause_time, cfg.start_paused);
let (time_driver, time_handle) =
create_time_driver(cfg.enable_time, io_stack, clock.clone());
Ok((
Self { inner: time_driver },
Resources {
io_handle,
signal_handle,
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | b891714bdb3ff8a52c356bbaa0cddd9206f42cfd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b891714bdb3ff8a52c356bbaa0cddd9206f42cfd/tokio/src/runtime/driver.rs | 281 | 316 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::thread::{ParkThread, UnparkThread};
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
pub(crate) type IoDriver = crate::runtime::io::Driver;
pub(crate) type IoHandle = Option<crate::run... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 71b29b9409b52548c56102f993f9ff670060a22b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/71b29b9409b52548c56102f993f9ff670060a22b/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | }
impl IoStack {
pub(crate) fn unpark(&self) -> IoUnpark {
match self {
IoStack::Enabled(v) => IoUnpark::Enabled(v.handle()),
IoStack::Disabled(v) => IoUnpark::Disabled(v.unpark()),
}
}
pub(crate) fn park(&mut self) {
matc... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 71b29b9409b52548c56102f993f9ff670060a22b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/71b29b9409b52548c56102f993f9ff670060a22b/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | }
cfg_not_io_driver! {
pub(crate) type IoHandle = ();
pub(crate) type IoStack = ParkThread;
pub(crate) type IoUnpark = UnparkThread;
fn create_io_stack(_enabled: bool) -> io::Result<(IoStack, IoHandle, SignalHandle)> {
Ok((ParkThread::new(), Default::default(), Default::default()))
}
}
//... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 71b29b9409b52548c56102f993f9ff670060a22b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/71b29b9409b52548c56102f993f9ff670060a22b/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | }
}
}
// ===== process driver =====
cfg_process_driver! {
type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driv... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 71b29b9409b52548c56102f993f9ff670060a22b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/71b29b9409b52548c56102f993f9ff670060a22b/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | pub(crate) type Clock = crate::time::Clock;
pub(crate) type TimeHandle = Option<crate::runtime::time::Handle>;
fn create_clock(enable_pausing: bool, start_paused: bool) -> Clock {
crate::time::Clock::new(enable_pausing, start_paused)
}
fn create_time_driver(
enable: bool,
io_st... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 71b29b9409b52548c56102f993f9ff670060a22b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/71b29b9409b52548c56102f993f9ff670060a22b/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | TimeDriver::Disabled(v) => v.park_timeout(duration),
}
}
// TODO: tokio-rs/tokio#4990, should the `current_thread` scheduler call this?
cfg_rt_multi_thread! {
pub(crate) fn shutdown(&mut self) {
match self {
TimeDriver::Enabled { drive... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 71b29b9409b52548c56102f993f9ff670060a22b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/71b29b9409b52548c56102f993f9ff670060a22b/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | }
}
}
// ===== process driver =====
cfg_process_driver! {
type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driv... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 99aa8d12b7ad2ef011a7a9f652f7455b3f175821 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/99aa8d12b7ad2ef011a7a9f652f7455b3f175821/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | fn create_clock(enable_pausing: bool, start_paused: bool) -> Clock {
crate::time::Clock::new(enable_pausing, start_paused)
}
fn create_time_driver(
enable: bool,
io_stack: IoStack,
clock: Clock,
) -> (TimeDriver, TimeHandle) {
if enable {
let driver = cra... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 99aa8d12b7ad2ef011a7a9f652f7455b3f175821 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/99aa8d12b7ad2ef011a7a9f652f7455b3f175821/tokio/src/runtime/driver.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | }
// TODO: tokio-rs/tokio#4990, should the `current_thread` scheduler call this?
cfg_rt_multi_thread! {
pub(crate) fn shutdown(&mut self) {
match self {
TimeDriver::Enabled(v) => v.shutdown(),
TimeDriver::Disabled(v) => v.shutdown(),
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 99aa8d12b7ad2ef011a7a9f652f7455b3f175821 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/99aa8d12b7ad2ef011a7a9f652f7455b3f175821/tokio/src/runtime/driver.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:7 | }
}
// ===== runtime driver =====
#[derive(Debug)]
pub(crate) struct Driver {
inner: TimeDriver,
}
pub(crate) type Unpark = TimerUnpark;
pub(crate) struct Resources {
pub(crate) io_handle: IoHandle,
pub(crate) signal_handle: SignalHandle,
pub(crate) time_handle: TimeHandle,
pub(crate) clock: Clo... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 99aa8d12b7ad2ef011a7a9f652f7455b3f175821 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/99aa8d12b7ad2ef011a7a9f652f7455b3f175821/tokio/src/runtime/driver.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:8 | time_handle,
clock,
},
))
}
pub(crate) fn unpark(&self) -> TimerUnpark {
self.inner.unpark()
}
pub(crate) fn park(&mut self) {
self.inner.park()
}
pub(crate) fn park_timeout(&mut self, duration: Duration) {
self.inner.park_timeout(du... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 99aa8d12b7ad2ef011a7a9f652f7455b3f175821 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/99aa8d12b7ad2ef011a7a9f652f7455b3f175821/tokio/src/runtime/driver.rs | 281 | 305 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::thread::ParkThread;
use crate::park::Park;
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
type IoDriver = crate::runtime::io::Driver;
type IoStack = crate::park::either::Either<Proce... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | bbfd34f6a3ff099ca9c96df90692afc60353feb7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bbfd34f6a3ff099ca9c96df90692afc60353feb7/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | fn create_io_stack(_enabled: bool) -> io::Result<(IoStack, IoHandle, SignalHandle)> {
Ok((ParkThread::new(), Default::default(), Default::default()))
}
}
// ===== signal driver =====
macro_rules! cfg_signal_internal_and_unix {
($($item:item)*) => {
#[cfg(unix)]
cfg_signal_internal! { $... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | bbfd34f6a3ff099ca9c96df90692afc60353feb7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bbfd34f6a3ff099ca9c96df90692afc60353feb7/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
fn create_... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | bbfd34f6a3ff099ca9c96df90692afc60353feb7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bbfd34f6a3ff099ca9c96df90692afc60353feb7/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | (Either::A(driver), Some(handle))
} else {
(Either::B(io_stack), None)
}
}
}
cfg_not_time! {
type TimeDriver = IoStack;
pub(crate) type Clock = ();
pub(crate) type TimeHandle = ();
fn create_clock(_enable_pausing: bool, _start_paused: bool) -> Clock {
()
}
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | bbfd34f6a3ff099ca9c96df90692afc60353feb7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bbfd34f6a3ff099ca9c96df90692afc60353feb7/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | pub(crate) struct Cfg {
pub(crate) enable_io: bool,
pub(crate) enable_time: bool,
pub(crate) enable_pause_time: bool,
pub(crate) start_paused: bool,
}
impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Resources)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | bbfd34f6a3ff099ca9c96df90692afc60353feb7 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/bbfd34f6a3ff099ca9c96df90692afc60353feb7/tokio/src/runtime/driver.rs | 161 | 208 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> ProcessDriver {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
fn create_... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 218f2629fffa25912ee14a2cc8ec6e98ae223b11 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/218f2629fffa25912ee14a2cc8ec6e98ae223b11/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::thread::ParkThread;
use crate::park::Park;
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
type IoDriver = crate::io::driver::Driver;
type IoStack = crate::park::either::Either<Proces... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | e188e99ca3bae5fe9a3e8622b59094388259cd84 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e188e99ca3bae5fe9a3e8622b59094388259cd84/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::thread::ParkThread;
use crate::park::Park;
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
type IoDriver = crate::io::driver::Driver;
type IoStack = crate::park::either::Either<Proces... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | fcb6d041b9d2fe567b5306e648cbb048b426a49d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/fcb6d041b9d2fe567b5306e648cbb048b426a49d/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | fn create_io_stack(_enabled: bool) -> io::Result<(IoStack, IoHandle, SignalHandle)> {
Ok((ParkThread::new(), Default::default(), Default::default()))
}
}
// ===== signal driver =====
macro_rules! cfg_signal_internal_and_unix {
($($item:item)*) => {
#[cfg(unix)]
cfg_signal_internal! { $... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | fcb6d041b9d2fe567b5306e648cbb048b426a49d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/fcb6d041b9d2fe567b5306e648cbb048b426a49d/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> io::Result<ProcessDriver> {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | fcb6d041b9d2fe567b5306e648cbb048b426a49d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/fcb6d041b9d2fe567b5306e648cbb048b426a49d/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> io::Result<ProcessDriver> {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | abd4c0025539f142ec48a09e01430f7ee3b83214 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/abd4c0025539f142ec48a09e01430f7ee3b83214/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | (Either::A(driver), Some(handle))
} else {
(Either::B(io_stack), None)
}
}
}
cfg_not_time! {
type TimeDriver = IoStack;
pub(crate) type Clock = ();
pub(crate) type TimeHandle = ();
fn create_clock(_enable_pausing: bool) -> Clock {
()
}
fn create_time_d... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | abd4c0025539f142ec48a09e01430f7ee3b83214 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/abd4c0025539f142ec48a09e01430f7ee3b83214/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | pub(crate) struct Cfg {
pub(crate) enable_io: bool,
pub(crate) enable_time: bool,
pub(crate) enable_pause_time: bool,
}
impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Resources)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.enable_io)?;
let clock = c... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | abd4c0025539f142ec48a09e01430f7ee3b83214 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/abd4c0025539f142ec48a09e01430f7ee3b83214/tokio/src/runtime/driver.rs | 161 | 206 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | type ProcessDriver = crate::process::unix::driver::Driver;
fn create_process_driver(signal_driver: SignalDriver) -> io::Result<ProcessDriver> {
crate::process::unix::driver::Driver::new(signal_driver)
}
}
cfg_not_process_driver! {
cfg_io_driver! {
type ProcessDriver = SignalDriver;
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 24d0a0cfa8916eaef17f40f044d978aa3904d654 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/24d0a0cfa8916eaef17f40f044d978aa3904d654/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | (Either::A(driver), Some(handle))
} else {
(Either::B(io_stack), None)
}
}
}
cfg_not_time! {
type TimeDriver = IoStack;
pub(crate) type Clock = ();
pub(crate) type TimeHandle = ();
fn create_clock() -> Clock {
()
}
fn create_time_driver(
_enabl... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 24d0a0cfa8916eaef17f40f044d978aa3904d654 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/24d0a0cfa8916eaef17f40f044d978aa3904d654/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | pub(crate) struct Cfg {
pub(crate) enable_io: bool,
pub(crate) enable_time: bool,
}
impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Resources)> {
let (io_stack, io_handle, signal_handle) = create_io_stack(cfg.enable_io)?;
let clock = create_clock();
let (time_driver,... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 24d0a0cfa8916eaef17f40f044d978aa3904d654 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/24d0a0cfa8916eaef17f40f044d978aa3904d654/tokio/src/runtime/driver.rs | 161 | 205 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::thread::ParkThread;
use crate::park::Park;
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
type IoDriver = crate::park::either::Either<crate::io::driver::Driver, ParkThread>;
pub(crat... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | // ===== signal driver =====
macro_rules! cfg_signal_internal_and_unix {
($($item:item)*) => {
#[cfg(unix)]
cfg_signal_internal! { $($item)* }
}
}
cfg_signal_internal_and_unix! {
type SignalDriver = crate::park::either::Either<crate::signal::unix::driver::Driver, IoDriver>;
pub(crate) ... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | cfg_process_driver! {
type ProcessDriver = crate::park::either::Either<crate::process::unix::driver::Driver, SignalDriver>;
fn create_process_driver(signal_driver: SignalDriver) -> io::Result<ProcessDriver> {
use crate::park::either::Either;
// Enable the signal driver if IO is also enabled
... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | clock: Clock,
) -> (TimeDriver, TimeHandle) {
use crate::park::either::Either;
if enable {
let driver = crate::time::driver::Driver::new(process_driver, clock);
let handle = driver.handle();
(Either::A(driver), Some(handle))
} else {
(Either:... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | pub(crate) struct Resources {
pub(crate) io_handle: IoHandle,
pub(crate) signal_handle: SignalHandle,
pub(crate) time_handle: TimeHandle,
pub(crate) clock: Clock,
}
pub(crate) struct Cfg {
pub(crate) enable_io: bool,
pub(crate) enable_time: bool,
}
impl Driver {
pub(crate) fn new(cfg: Cfg)... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/runtime/driver.rs | 161 | 215 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | self.inner.unpark()
}
fn park(&mut self) -> Result<(), Self::Error> {
self.inner.park()
}
fn park_timeout(&mut self, duration: Duration) -> Result<(), Self::Error> {
self.inner.park_timeout(duration)
}
fn shutdown(&mut self) {
self.inner.shutdown()
}
} | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/runtime/driver.rs | 201 | 215 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:1 | //! Abstracts out the entire chain of runtime sub-drivers into common types.
use crate::park::{Park, ParkThread};
use std::io;
use std::time::Duration;
// ===== io driver =====
cfg_io_driver! {
type IoDriver = crate::park::Either<crate::io::driver::Driver, crate::park::ParkThread>;
pub(crate) type IoHandle = ... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 4cf45c038b9691f24fac22df13594c2223b185f6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cf45c038b9691f24fac22df13594c2223b185f6/tokio/src/runtime/driver.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:2 | macro_rules! cfg_signal_internal_and_unix {
($($item:item)*) => {
#[cfg(unix)]
cfg_signal_internal! { $($item)* }
}
}
cfg_signal_internal_and_unix! {
type SignalDriver = crate::park::Either<crate::signal::unix::driver::Driver, IoDriver>;
pub(crate) type SignalHandle = Option<crate::sign... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 4cf45c038b9691f24fac22df13594c2223b185f6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cf45c038b9691f24fac22df13594c2223b185f6/tokio/src/runtime/driver.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:3 | fn create_process_driver(signal_driver: SignalDriver) -> io::Result<ProcessDriver> {
use crate::park::Either;
// Enable the signal driver if IO is also enabled
match signal_driver {
Either::A(signal_driver) => {
let driver = crate::process::unix::driver::Driver::new(... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 4cf45c038b9691f24fac22df13594c2223b185f6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cf45c038b9691f24fac22df13594c2223b185f6/tokio/src/runtime/driver.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:4 | use crate::park::Either;
if enable {
let driver = crate::time::driver::Driver::new(process_driver, clock);
let handle = driver.handle();
(Either::A(driver), Some(handle))
} else {
(Either::B(process_driver), None)
}
}
}
cfg_not_time! {
t... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 4cf45c038b9691f24fac22df13594c2223b185f6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cf45c038b9691f24fac22df13594c2223b185f6/tokio/src/runtime/driver.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:5 | pub(crate) io_handle: IoHandle,
pub(crate) signal_handle: SignalHandle,
pub(crate) time_handle: TimeHandle,
pub(crate) clock: Clock,
}
pub(crate) struct Cfg {
pub(crate) enable_io: bool,
pub(crate) enable_time: bool,
}
impl Driver {
pub(crate) fn new(cfg: Cfg) -> io::Result<(Self, Resources)> ... | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 4cf45c038b9691f24fac22df13594c2223b185f6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cf45c038b9691f24fac22df13594c2223b185f6/tokio/src/runtime/driver.rs | 161 | 213 |
tokio-rs/tokio:tokio/src/runtime/driver.rs:6 | fn park(&mut self) -> Result<(), Self::Error> {
self.inner.park()
}
fn park_timeout(&mut self, duration: Duration) -> Result<(), Self::Error> {
self.inner.park_timeout(duration)
}
fn shutdown(&mut self) {
self.inner.shutdown()
}
} | rust | rust | macro-heavy | tokio-rs/tokio | tokio/src/runtime/driver.rs | MIT | 4cf45c038b9691f24fac22df13594c2223b185f6 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/4cf45c038b9691f24fac22df13594c2223b185f6/tokio/src/runtime/driver.rs | 201 | 213 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.