Skip to main content

Mojo struct

ThreadRole

@register_passable(trivial) struct ThreadRole

Implemented traits

AnyType, Copyable, Enum, ImplicitlyCopyable, Movable, Stringable, UnknownDestructibility, Writable

Aliases

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

CONSUMER

comptime CONSUMER = ThreadRole(1)

PRODUCER

comptime PRODUCER = ThreadRole(0)

PRODUCER_CONSUMER

comptime PRODUCER_CONSUMER = ThreadRole(2)

Methods

value

value(self) -> Int

Returns:

Int

__str__

__str__(self) -> String

Returns the string representation of this algorithm.

Returns:

String: String: A human-readable string representation of the algorithm.

write_to

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

Was this page helpful?