Print functionv0.1.0
pub func Print(value: String) -> IoError?
pub func Print(value: StringView) -> IoError?
pub func Print(value: char8[..]) -> IoError?
pub func Print(#Format() format: char8[..], ...) -> IoError?
pub func Print(value: bool8) -> IoError?
pub func Print(value: bool16) -> IoError?
pub func Print(value: bool32) -> IoError?
pub func Print(value: bool64) -> IoError?
pub func Print(value: bool128) -> IoError?
pub func Print(value: bool256) -> IoError?
pub func Print(value: bool512) -> IoError?
pub func Print(value: char8) -> IoError?
pub func Print(value: char16) -> IoError?
pub func Print(value: char32) -> IoError?
pub func Print(value: char64) -> IoError?
pub func Print(value: char128) -> IoError?
pub func Print(value: char256) -> IoError?
pub func Print(value: char512) -> IoError?
pub func Print(value: int8) -> IoError?
pub func Print(value: int16) -> IoError?
pub func Print(value: int32) -> IoError?
pub func Print(value: int64) -> IoError?
pub func Print(value: uint8) -> IoError?
pub func Print(value: uint16) -> IoError?
pub func Print(value: uint32) -> IoError?
pub func Print(value: uint64) -> IoError?
pub func Print(value: int) -> IoError?
pub func Print(value: uint) -> IoError?
pub func Print(value: float8) -> IoError?
pub func Print(value: float16) -> IoError?
pub func Print(value: float32) -> IoError?
pub func Print(value: float64) -> IoError?
A String, a StringView or a char8[..] is written as the UTF-8 bytes it holds, unchanged: nothing is
substituted and no brace is special, so Print("{{}}") writes {{}}. Each primitive overload writes its value as
PrintValue does, through the type's Display conformance, and any other value goes through PrintValue itself.
Given arguments after it, the first text is a pattern instead: each {} or {:spec} takes the next argument in
order, and {{ and }} write a literal brace.
Every overload returns the failure its write met as an IoError, or none. A program logging to a terminal loses
nothing by ignoring it; one whose output feeds a pipe that may close has something to look at.
| Overload | Summary |
|---|---|
pub func Print(value: String) -> IoError? | Writes a value's text to standard output. |
pub func Print(value: StringView) -> IoError? | Writes the text a StringView borrows to standard output. |
pub func Print(value: char8[..]) -> IoError? | Writes text to standard output. |
pub func Print(#Format() format: char8[..], ...) -> IoError? | Writes format to standard output with each {} replaced by the next argument. |
pub func Print(value: bool8) -> IoError? | Writes a bool8 to standard output. |
pub func Print(value: bool16) -> IoError? | Writes a bool16 to standard output. |
pub func Print(value: bool32) -> IoError? | Writes a bool32 to standard output. |
pub func Print(value: bool64) -> IoError? | Writes a bool64 to standard output. |
pub func Print(value: bool128) -> IoError? | Writes a bool128 to standard output. |
pub func Print(value: bool256) -> IoError? | Writes a bool256 to standard output. |
pub func Print(value: bool512) -> IoError? | Writes a bool512 to standard output. |
pub func Print(value: char8) -> IoError? | Writes a char8 to standard output. |
pub func Print(value: char16) -> IoError? | Writes a char16 to standard output. |
pub func Print(value: char32) -> IoError? | Writes a char32 to standard output. |
pub func Print(value: char64) -> IoError? | Writes a char64 to standard output. |
pub func Print(value: char128) -> IoError? | Writes a char128 to standard output. |
pub func Print(value: char256) -> IoError? | Writes a char256 to standard output. |
pub func Print(value: char512) -> IoError? | Writes a char512 to standard output. |
pub func Print(value: int8) -> IoError? | Writes a int8 to standard output. |
pub func Print(value: int16) -> IoError? | Writes a int16 to standard output. |
pub func Print(value: int32) -> IoError? | Writes a int32 to standard output. |
pub func Print(value: int64) -> IoError? | Writes a int64 to standard output. |
pub func Print(value: uint8) -> IoError? | Writes a uint8 to standard output. |
pub func Print(value: uint16) -> IoError? | Writes a uint16 to standard output. |
pub func Print(value: uint32) -> IoError? | Writes a uint32 to standard output. |
pub func Print(value: uint64) -> IoError? | Writes a uint64 to standard output. |
pub func Print(value: int) -> IoError? | Writes a int to standard output. |
pub func Print(value: uint) -> IoError? | Writes a uint to standard output. |
pub func Print(value: float8) -> IoError? | Writes a float8 to standard output. |
pub func Print(value: float16) -> IoError? | Writes a float16 to standard output. |
pub func Print(value: float32) -> IoError? | Writes a float32 to standard output. |
pub func Print(value: float64) -> IoError? | Writes a float64 to standard output. |
Parameters
| Name | Type | Description |
|---|---|---|
value | String | the value to write |
value | StringView | the value to write |
value | char8[..] | the value to write |
#Format() format | char8[..] | |
... | ||
value | bool8 | the value to write |
value | bool16 | the value to write |
value | bool32 | the value to write |
value | bool64 | the value to write |
value | bool128 | the value to write |
value | bool256 | the value to write |
value | bool512 | the value to write |
value | char8 | the value to write |
value | char16 | the value to write |
value | char32 | the value to write |
value | char64 | the value to write |
value | char128 | the value to write |
value | char256 | the value to write |
value | char512 | the value to write |
value | int8 | the value to write |
value | int16 | the value to write |
value | int32 | the value to write |
value | int64 | the value to write |
value | uint8 | the value to write |
value | uint16 | the value to write |
value | uint32 | the value to write |
value | uint64 | the value to write |
value | int | the value to write |
value | uint | the value to write |
value | float8 | the value to write |
value | float16 | the value to write |
value | float32 | the value to write |
value | float64 | the value to write |
Returns: the failure, or none when the whole value was written
Related
PrintValue
pub func PrintValue(value: Display) -> IoError?
Writes a value's text to standard output.
Nothing is allocated: the value writes itself straight to the stream.
The value arrives as an interface value, which copies it — or takes it, for a type that prohibits copying.
WriteValueLine is the borrowing form, and takes any destination, so a value that must not be given up goes
through a ConsoleWriter and that instead.
A stream failure is returned as the stream reported it. A formatting failure on a healthy stream is translated
by ToIoError, so a request that was wrong arrives as InvalidInput and stays distinguishable from anything
the destination did. Which formatting failure it was does not survive that translation, since IoError has no
room for one; a caller who needs it builds a ConsoleWriter and calls Text::WriteValue themselves.
Parameters
| Name | Type | Description |
|---|---|---|
value | Display | the value to write |
Returns: what the stream reported, or the translated formatting failure on a healthy stream, or none