Mojo struct
Format
struct Format
Defines a format for the benchmark output when printing or writing to a file.
Fields
- value (StringSlice[StaticConstantOrigin]): The format to print results.
Implemented traits
AnyType,
Copyable,
ImplicitlyCopyable,
Movable,
Stringable,
UnknownDestructibility,
Writable
Aliases
__copyinit__is_trivial
alias __copyinit__is_trivial = StringSlice[StaticConstantOrigin].__copyinit__is_trivial
__del__is_trivial
alias __del__is_trivial = StringSlice[StaticConstantOrigin].__del__is_trivial
__moveinit__is_trivial
alias __moveinit__is_trivial = StringSlice[StaticConstantOrigin].__moveinit__is_trivial
csv
alias csv = Format("csv")
Comma separated values with no alignment.
table
alias table = Format("table")
Table format with dynamically aligned columns.
tabular
alias tabular = Format("tabular")
Comma separated values with dynamically aligned columns.
Methods
__init__
__init__(out self, value: StringSlice[origin])
Constructs a Format object from a string.
Args:
- value (StringSlice): The format to print results.
__eq__
__eq__(self, other: Self) -> Bool
Checks if two Format objects are equal.
Args:
- other (Self): TheFormatto compare with.
Returns:
Bool: True if the two Format objects are equal, false otherwise.
__str__
__str__(self) -> String
Returns the string representation of the format.
Returns:
String: The string representation of the format.
write_to
write_to(self, mut writer: T)
Writes the format to a writer.
Args:
- writer (T): The writer to write theFormatto.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
