userOf method

  1. @Deprecated('Use read, whose Unread says why there is no user.')
UserId? userOf(
  1. Socket socket
)

The user on the other end of socket; null whenever read answers Unread.

Implementation

@Deprecated('Use read, whose Unread says why there is no user.')
UserId? userOf(Socket socket) => switch (read(socket)) {
  UserRead(:final user) => user,
  Unread() => null,
};