ssh_cli/ssh/sftp_types.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2// G-SFTP: shared SFTP DTO types (always available; no russh-sftp dep).
3#![forbid(unsafe_code)]
4//! SFTP list/stat DTOs shared by the SSH engine and output layer.
5
6/// Directory entry for `sftp ls` JSON/text.
7#[derive(Debug, Clone)]
8pub struct SftpListEntry {
9 /// Base name.
10 pub name: String,
11 /// Full remote path.
12 pub path: String,
13 /// `file` | `dir` | `symlink` | `other`.
14 pub kind: String,
15 /// Size when known.
16 pub size: Option<u64>,
17 /// Mode bits when known.
18 pub mode: Option<u32>,
19}
20
21/// Stat payload for `sftp stat`.
22#[derive(Debug, Clone)]
23pub struct SftpStat {
24 /// Remote path queried.
25 pub path: String,
26 /// `file` | `dir` | `symlink` | `other`.
27 pub kind: String,
28 /// Size when known.
29 pub size: Option<u64>,
30 /// Mode bits when known.
31 pub mode: Option<u32>,
32 /// mtime unix seconds when known.
33 pub mtime: Option<u32>,
34}