mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
rt: add error documentation for runtime::Builder (#8297)
This commit is contained in:
@@ -1069,6 +1069,11 @@ impl Builder {
|
|||||||
/// });
|
/// });
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns an error if the I/O driver or other OS resources required by the
|
||||||
|
/// runtime cannot be initialized.
|
||||||
pub fn build(&mut self) -> io::Result<Runtime> {
|
pub fn build(&mut self) -> io::Result<Runtime> {
|
||||||
match &self.kind {
|
match &self.kind {
|
||||||
Kind::CurrentThread => self.build_current_thread_runtime(),
|
Kind::CurrentThread => self.build_current_thread_runtime(),
|
||||||
@@ -1100,6 +1105,11 @@ impl Builder {
|
|||||||
/// println!("Hello from the Tokio runtime");
|
/// println!("Hello from the Tokio runtime");
|
||||||
/// });
|
/// });
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns an error if the I/O driver or other OS resources required by the
|
||||||
|
/// runtime cannot be initialized.
|
||||||
pub fn build_local(&mut self, _options: LocalOptions) -> io::Result<LocalRuntime> {
|
pub fn build_local(&mut self, _options: LocalOptions) -> io::Result<LocalRuntime> {
|
||||||
match &self.kind {
|
match &self.kind {
|
||||||
Kind::CurrentThread => self.build_current_thread_local_runtime(),
|
Kind::CurrentThread => self.build_current_thread_local_runtime(),
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ impl LocalRuntime {
|
|||||||
/// // Use the runtime...
|
/// // Use the runtime...
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns an error if the I/O driver or other OS resources required by the
|
||||||
|
/// runtime cannot be initialized.
|
||||||
|
///
|
||||||
/// [mod]: crate::runtime
|
/// [mod]: crate::runtime
|
||||||
/// [runtime builder]: crate::runtime::Builder
|
/// [runtime builder]: crate::runtime::Builder
|
||||||
pub fn new() -> std::io::Result<LocalRuntime> {
|
pub fn new() -> std::io::Result<LocalRuntime> {
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ impl Runtime {
|
|||||||
/// // Use the runtime...
|
/// // Use the runtime...
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns an error if the I/O driver or other OS resources required by the
|
||||||
|
/// runtime cannot be initialized.
|
||||||
|
///
|
||||||
/// [mod]: index.html
|
/// [mod]: index.html
|
||||||
/// [main]: ../attr.main.html
|
/// [main]: ../attr.main.html
|
||||||
/// [threaded scheduler]: index.html#threaded-scheduler
|
/// [threaded scheduler]: index.html#threaded-scheduler
|
||||||
|
|||||||
Reference in New Issue
Block a user