IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

DictKeyError

struct DictKeyError[K: KeyElement]

A custom error type for Dict lookups that fail.

Parameters​

  • ​K (KeyElement): The key type of the elements in the dictionary.

Implemented traits​

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, Writable

Methods​

write_to​

def write_to(self, mut writer: T)

Write the error and the key to the writer.

Args:

  • ​writer (T): The writer to write to.

write_repr_to​

def write_repr_to(self, mut writer: T)

Write the error to the writer.

Args:

  • ​writer (T): The writer to write to.