Struct Id

pub struct Id(/* private field */);

An opaque ID that uniquely identifies a runtime relative to all other currently running runtimes.

Notes

Examples

# #[cfg(not(target_family = "wasm"))]
# {
use tokio::runtime::Handle;

#[tokio::main(flavor = "multi_thread", worker_threads = 4)]
async fn main() {
  println!("Current runtime id: {}", Handle::current().id());
}
# }

Trait Implementations

impl Clone for Id

fn clone(&self) -> Id

impl Copy for Id

impl Debug for Id

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Display for Id

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for Id

impl Hash for Id

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for Id

fn eq(&self, other: &Id) -> bool

impl StructuralPartialEq for Id

Auto Trait Implementations

impl Freeze for Id

impl RefUnwindSafe for Id

impl Send for Id

impl Sync for Id

impl Unpin for Id

impl UnsafeUnpin for Id

impl UnwindSafe for Id

Blanket Implementations

impl<T> Any for Id where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Id where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Id where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Id where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Id

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Id where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for Id where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for Id where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Id where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Id where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>