lisette-stdlib 0.2.13

Little language inspired by Rust that compiles to Go
Documentation
// Generated by Lisette bindgen
// Source: os/user (Go stdlib)
// Go: 1.25.10
// Lisette: 0.2.1

/// Current returns the current user.
/// 
/// The first call will cache the current user information.
/// Subsequent calls will return the cached value and will not reflect
/// changes to the current user.
pub fn Current() -> Result<Ref<User>, error>

/// Lookup looks up a user by username. If the user cannot be found, the
/// returned error is of type [UnknownUserError].
pub fn Lookup(username: string) -> Result<Ref<User>, error>

/// LookupGroup looks up a group by name. If the group cannot be found, the
/// returned error is of type [UnknownGroupError].
pub fn LookupGroup(name: string) -> Result<Ref<Group>, error>

/// LookupGroupId looks up a group by groupid. If the group cannot be found, the
/// returned error is of type [UnknownGroupIdError].
pub fn LookupGroupId(gid: string) -> Result<Ref<Group>, error>

/// LookupId looks up a user by userid. If the user cannot be found, the
/// returned error is of type [UnknownUserIdError].
pub fn LookupId(uid: string) -> Result<Ref<User>, error>

/// Group represents a grouping of users.
/// 
/// On POSIX systems Gid contains a decimal number representing the group ID.
pub struct Group {
  pub Gid: string,
  pub Name: string,
}

/// UnknownGroupError is returned by [LookupGroup] when
/// a group cannot be found.
pub struct UnknownGroupError(string)

/// UnknownGroupIdError is returned by [LookupGroupId] when
/// a group cannot be found.
pub struct UnknownGroupIdError(string)

/// UnknownUserError is returned by [Lookup] when
/// a user cannot be found.
pub struct UnknownUserError(string)

/// UnknownUserIdError is returned by [LookupId] when a user cannot be found.
pub struct UnknownUserIdError(int)

/// User represents a user account.
pub struct User {
  pub Uid: string,
  pub Gid: string,
  pub Username: string,
  pub Name: string,
  pub HomeDir: string,
}

impl UnknownGroupError {
  fn Error(self) -> string
}

impl UnknownGroupIdError {
  fn Error(self) -> string
}

impl UnknownUserError {
  fn Error(self) -> string
}

impl UnknownUserIdError {
  fn Error(self) -> string
}

impl User {
  /// GroupIds returns the list of group IDs that the user is a member of.
  fn GroupIds(self: Ref<User>) -> Result<Slice<string>, error>
}