Skip to content

august/io/contracts.aug diagrams ​

Function and constructor middleware

Project overview · Compiled explanation

Class interactions ​

LocalFiles ​

100%
Mermaid source
flowchart LR
    n0["FileReader"]
    n1["FileWriter"]
    n2["LocalFiles"]
    n2 -->|"implements"| n0
    n2 -->|"implements"| n1

ProcessArguments ​

100%
Mermaid source
flowchart LR
    n0["Arguments"]
    n1["ProcessArguments"]
    n1 -->|"implements"| n0

SystemConsole ​

100%
Mermaid source
flowchart LR
    n0["Console"]
    n1["SystemConsole"]
    n1 -->|"implements"| n0

Sequences ​

Call arrows identify checked targets; loop and branch frames determine when they run. Open that target’s module to follow its implementation. Branches describe alternatives; loops describe repeated work. Native calls and interface dispatch stop at their declared contracts. Exit notes end that path; enclosing recovery and cleanup remain visible.

Console.write ​

Write one line of text.

The type parameters are T.

It takes value as T (Text to display).

It can call Console.write.

Interface contract; implementation selected at runtime. Explanation.

SystemConsole constructor ​

The native standard-output adapter. Construction performs no output. It implements Console.

Explanation.

SystemConsole.write ​

Write one line of text.

It takes value as T.

It can call Console.write.

100%
Mermaid source
sequenceDiagram
    participant p0 as SystemConsole.write
    participant p1 as August runtime
    p0->>p1: print(value=value)

FileReader.read ​

Read text.

It takes path as a string (File path).

It returns string. It can call FileReader.read. Failures can raise FileError (The file could not be read).

May leave with checked errors: FileError. Interface contract; implementation selected at runtime. Explanation.

FileWriter.write ​

Write text.

It takes path as a string (File path) and content as a string (Text).

It can call FileWriter.write. Failures can raise FileError (Writing failed).

May leave with checked errors: FileError. Interface contract; implementation selected at runtime. Explanation.

LocalFiles constructor ​

Native filesystem adapter. Construction opens no files. It implements FileReader and FileWriter.

Explanation.

LocalFiles.read ​

Read text.

It takes path as a string.

It can call FileReader.read. Failures can raise FileError (The file could not be read).

100%
Mermaid source
sequenceDiagram
    participant p0 as LocalFiles.read
    participant p1 as August runtime
    p0->>p1: read_file(path=path)
    p1-->>p0: read_file result: string
    Note over p0: Return read_file(path=path); required cleanup runs<br/>before exit
    Note over p0: May leave with checked errors: FileError

LocalFiles.write ​

Write text.

It takes path and content as strings.

It can call FileWriter.write. Failures can raise FileError (Writing failed).

100%
Mermaid source
sequenceDiagram
    participant p0 as LocalFiles.write
    participant p1 as August runtime
    p0->>p1: write_file(path=path, content=content)
    Note over p0: May leave with checked errors: FileError

Arguments.read ​

It returns List<string>. It can call Arguments.read.

Interface contract; implementation selected at runtime. Explanation.

ProcessArguments constructor ​

Native command-line arguments. It implements Arguments.

Explanation.

ProcessArguments.read ​

It can call Arguments.read.

100%
Mermaid source
sequenceDiagram
    participant p0 as ProcessArguments.read
    participant p1 as August runtime
    p0->>p1: arguments()
    p1-->>p0: arguments result: List‹string›
    Note over p0: Return arguments(); required cleanup runs before exit

Called contracts ​

Last updated:

The world runs on language