Skip to main content

Mojo struct

Passwd

struct Passwd

Represents user account information retrieved from the user password database related to a user ID.

Fields

  • pw_name (String): User name.
  • pw_passwd (String): User password.
  • pw_uid (Int): User ID.
  • pw_gid (Int): Group ID.
  • pw_gecos (String): Real name or comment field.
  • pw_dir (String): Home directory.
  • pw_shell (String): Shell program.

Implemented traits

AnyType, Copyable, Movable, Stringable, UnknownDestructibility, Writable

Methods

write_to

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

Formats this string to the provided Writer.

Parameters:

  • W (Writer): A type conforming to the Writable trait.

Args:

  • writer (W): The object to write to.

__str__

__str__(self) -> String

Gets the Passwd struct as a string.

Returns:

A compact string of the Passwd struct.

__repr__

__repr__(self) -> String

Gets the Passwd struct as a string.

Returns:

A compact string representation of Passwd struct.

Was this page helpful?