Skip to main content

Mojo struct

ThreadRole

struct ThreadRole

Implemented traits​

AnyType, Copyable, Enum, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable, Writable

comptime members​

CONSUMER​

comptime CONSUMER = ThreadRole(1)

PRODUCER​

comptime PRODUCER = ThreadRole(0)

PRODUCER_CONSUMER​

comptime PRODUCER_CONSUMER = ThreadRole(2)

Methods​

value​

value(self) -> Int

Returns:

Int

write_to​

write_to[W: Writer](self, mut writer: W)