Skip to main content
←API Reference ←NSDK ←NSDKDashcamSession

saveBuffer

Saves the current buffer contents and waits for completion.

Declaration​

@MainActor func saveBuffer(timeout: Double = 30.0, pollingInterval: TimeInterval = 0.5) async throws -> SaveResult

Summary​

Saves the current buffer contents and waits for completion.

Returns​

The SaveResult containing the save path on success.

Throws​

  • NSDKError.invalidOperation if the buffer is empty.
  • TimeoutError if the save does not complete within the timeout.
  • CancellationError if the running Task is cancelled.
  • SaveError.saveFailed if the native save operation failed.
Notice

Important: Runs on the main actor, where the session is created and started.

Parameters​

NameTypeSummary
timeoutDouble
Maximum duration in seconds to wait (default 30 seconds).
pollingIntervalTimeInterval
Interval in seconds between progress checks (default 0.5 seconds).