1.8 KiB
name, group, category, update-time, description, key-word
| name | group | category | update-time | description | key-word | ||||
|---|---|---|---|---|---|---|---|---|---|
| file-sink-path | api | sink | 20260613 | Read the configured file path used by a FileSink. |
|
File-sink-path
Read the configured file path used by a FileSink. This helper is useful for diagnostics, support output, and confirming which concrete file destination a sink is managing.
Interface
pub fn FileSink::path(self : FileSink) -> String {
input
self : FileSink- File sink whose path should be inspected.
output
String- Configured file path for the sink.
Explanation
Detailed rules explaining key parameters and behaviors
- This method returns the sink's stored file path directly.
- The path value is observation-only and does not imply current availability.
- Closing and reopening the sink do not change this stored path.
- This helper does not mutate sink state.
How to Use
Here are some specific examples provided.
When Need Direct Path Diagnostics
When diagnostics should show which file a concrete sink is managing:
println(sink.path())
In this example, operators can verify the direct file destination without reading broader runtime state.
When Build Support Output
When application state dumps should include the configured sink path:
let path = sink.path()
In this example, the path can be surfaced without reading policy or failure counters.
Error Case
e.g.:
-
If callers need to know whether the path is currently backed by an open handle,
is_available()is the better API. -
This helper returns the configured path even if open or reopen attempts have failed.
Notes
-
Use this helper for direct file-destination visibility.
-
It is a simple observation API and does not inspect wider sink health.