Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

AsyncDirectoryIterator

Owns consuming directory traversal and transfers independent entry owners. Successful EOF is sticky. Native step failures end traversal; pre-step cancellation/admission failures permit retry. External synchronization is required; destruction closes remaining enumeration synchronously. No raw native entry or borrowed name escapes.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.fs

import std.fs;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

AsyncDirectoryIterator

pub final class AsyncDirectoryIterator

Owns consuming directory traversal and transfers independent entry owners. Successful EOF is sticky. Native step failures end traversal; pre-step cancellation/admission failures permit retry. External synchronization is required; destruction closes remaining enumeration synchronously. No raw native entry or borrowed name escapes.

AsyncDirectoryIterator.init

pub init()

Creates an inert allocation-free cursor.

AsyncDirectoryIterator.init

pub init(Source: readonly Self&) = delete;

Rejects duplicated traversal authority. Source: Existing cursor.

AsyncDirectoryIterator.init

pub init(Source: mut Self&&)

Transfers remaining enumeration and terminal state. Source: Cursor left exhausted.

AsyncDirectoryIterator.operator

pub fn operator =(Source: readonly Self&) -> void = delete;

Rejects duplicated enumeration authority. Source: Existing cursor. Return: No runtime result; this assignment is deleted and cannot be invoked.

AsyncDirectoryIterator.operator

pub fn operator =(Source: mut Self&&) -> void = delete;

Requires explicit owner cleanup before replacement. Source: Existing cursor. Return: No runtime result; this assignment is deleted and cannot be invoked.

AsyncDirectoryIterator.NextAsync

pub async fn NextAsync(mut Token: CancellationToken) -> Task<Result<DirectoryEntry?, IoError>>

Reads one owned entry, preserving cancellation/admission retryability. Token: Cancellation observation for this step only. Return: Task yielding owned optional entry or exact source-specific error. Warning: One mutable step at a time; cursor must remain live while pending.

AsyncDirectoryIterator.NextAsync

pub fn NextAsync() -> Task<Result<DirectoryEntry?, IoError>>

Supplies the omitted arguments to NextAsync. Note: Defaults: Token = CancellationToken(). Return: Exact full-operation result; no additional async frame is created.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library