scratch_io/wharf/
pwr.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct PatchHeader {
4  #[prost(message, optional, tag = "1")]
5  pub compression: ::core::option::Option<CompressionSettings>,
6}
7#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8pub struct SyncHeader {
9  #[prost(enumeration = "sync_header::Type", tag = "1")]
10  pub r#type: i32,
11  #[prost(int64, tag = "16")]
12  pub file_index: i64,
13}
14/// Nested message and enum types in `SyncHeader`.
15pub mod sync_header {
16  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
17  #[repr(i32)]
18  pub enum Type {
19    Rsync = 0,
20    /// when set, bsdiffTargetIndex must be set
21    Bsdiff = 1,
22  }
23  impl Type {
24    /// String value of the enum field names used in the ProtoBuf definition.
25    ///
26    /// The values are not transformed in any way and thus are considered stable
27    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
28    pub fn as_str_name(&self) -> &'static str {
29      match self {
30        Self::Rsync => "RSYNC",
31        Self::Bsdiff => "BSDIFF",
32      }
33    }
34    /// Creates an enum from field names used in the ProtoBuf definition.
35    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
36      match value {
37        "RSYNC" => Some(Self::Rsync),
38        "BSDIFF" => Some(Self::Bsdiff),
39        _ => None,
40      }
41    }
42  }
43}
44#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
45pub struct BsdiffHeader {
46  #[prost(int64, tag = "1")]
47  pub target_index: i64,
48}
49#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
50pub struct SyncOp {
51  #[prost(enumeration = "sync_op::Type", tag = "1")]
52  pub r#type: i32,
53  #[prost(int64, tag = "2")]
54  pub file_index: i64,
55  #[prost(int64, tag = "3")]
56  pub block_index: i64,
57  #[prost(int64, tag = "4")]
58  pub block_span: i64,
59  #[prost(bytes = "vec", tag = "5")]
60  pub data: ::prost::alloc::vec::Vec<u8>,
61}
62/// Nested message and enum types in `SyncOp`.
63pub mod sync_op {
64  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
65  #[repr(i32)]
66  pub enum Type {
67    BlockRange = 0,
68    Data = 1,
69    /// <3 @GranPC & @tomasduda
70    HeyYouDidIt = 2049,
71  }
72  impl Type {
73    /// String value of the enum field names used in the ProtoBuf definition.
74    ///
75    /// The values are not transformed in any way and thus are considered stable
76    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
77    pub fn as_str_name(&self) -> &'static str {
78      match self {
79        Self::BlockRange => "BLOCK_RANGE",
80        Self::Data => "DATA",
81        Self::HeyYouDidIt => "HEY_YOU_DID_IT",
82      }
83    }
84    /// Creates an enum from field names used in the ProtoBuf definition.
85    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
86      match value {
87        "BLOCK_RANGE" => Some(Self::BlockRange),
88        "DATA" => Some(Self::Data),
89        "HEY_YOU_DID_IT" => Some(Self::HeyYouDidIt),
90        _ => None,
91      }
92    }
93  }
94}
95#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
96pub struct SignatureHeader {
97  #[prost(message, optional, tag = "1")]
98  pub compression: ::core::option::Option<CompressionSettings>,
99}
100#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
101pub struct BlockHash {
102  #[prost(uint32, tag = "1")]
103  pub weak_hash: u32,
104  #[prost(bytes = "vec", tag = "2")]
105  pub strong_hash: ::prost::alloc::vec::Vec<u8>,
106}
107#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
108pub struct CompressionSettings {
109  #[prost(enumeration = "CompressionAlgorithm", tag = "1")]
110  pub algorithm: i32,
111  #[prost(int32, tag = "2")]
112  pub quality: i32,
113}
114#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
115pub struct ManifestHeader {
116  #[prost(message, optional, tag = "1")]
117  pub compression: ::core::option::Option<CompressionSettings>,
118  #[prost(enumeration = "HashAlgorithm", tag = "2")]
119  pub algorithm: i32,
120}
121#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
122pub struct ManifestBlockHash {
123  #[prost(bytes = "vec", tag = "1")]
124  pub hash: ::prost::alloc::vec::Vec<u8>,
125}
126/// Wounds files format: header, container, then any
127/// number of Wounds
128#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
129pub struct WoundsHeader {}
130/// Describe a corrupted portion of a file, in [start,end)
131#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
132pub struct Wound {
133  #[prost(int64, tag = "1")]
134  pub index: i64,
135  #[prost(int64, tag = "2")]
136  pub start: i64,
137  #[prost(int64, tag = "3")]
138  pub end: i64,
139  #[prost(enumeration = "WoundKind", tag = "4")]
140  pub kind: i32,
141}
142#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
143#[repr(i32)]
144pub enum CompressionAlgorithm {
145  None = 0,
146  Brotli = 1,
147  Gzip = 2,
148  Zstd = 3,
149}
150impl CompressionAlgorithm {
151  /// String value of the enum field names used in the ProtoBuf definition.
152  ///
153  /// The values are not transformed in any way and thus are considered stable
154  /// (if the ProtoBuf definition does not change) and safe for programmatic use.
155  pub fn as_str_name(&self) -> &'static str {
156    match self {
157      Self::None => "NONE",
158      Self::Brotli => "BROTLI",
159      Self::Gzip => "GZIP",
160      Self::Zstd => "ZSTD",
161    }
162  }
163  /// Creates an enum from field names used in the ProtoBuf definition.
164  pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
165    match value {
166      "NONE" => Some(Self::None),
167      "BROTLI" => Some(Self::Brotli),
168      "GZIP" => Some(Self::Gzip),
169      "ZSTD" => Some(Self::Zstd),
170      _ => None,
171    }
172  }
173}
174#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
175#[repr(i32)]
176pub enum HashAlgorithm {
177  Shake12832 = 0,
178  Crc32c = 1,
179}
180impl HashAlgorithm {
181  /// String value of the enum field names used in the ProtoBuf definition.
182  ///
183  /// The values are not transformed in any way and thus are considered stable
184  /// (if the ProtoBuf definition does not change) and safe for programmatic use.
185  pub fn as_str_name(&self) -> &'static str {
186    match self {
187      Self::Shake12832 => "SHAKE128_32",
188      Self::Crc32c => "CRC32C",
189    }
190  }
191  /// Creates an enum from field names used in the ProtoBuf definition.
192  pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
193    match value {
194      "SHAKE128_32" => Some(Self::Shake12832),
195      "CRC32C" => Some(Self::Crc32c),
196      _ => None,
197    }
198  }
199}
200#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
201#[repr(i32)]
202pub enum WoundKind {
203  File = 0,
204  Symlink = 1,
205  Dir = 2,
206  /// sent when a file portion has been verified as valid
207  ClosedFile = 3,
208}
209impl WoundKind {
210  /// String value of the enum field names used in the ProtoBuf definition.
211  ///
212  /// The values are not transformed in any way and thus are considered stable
213  /// (if the ProtoBuf definition does not change) and safe for programmatic use.
214  pub fn as_str_name(&self) -> &'static str {
215    match self {
216      Self::File => "FILE",
217      Self::Symlink => "SYMLINK",
218      Self::Dir => "DIR",
219      Self::ClosedFile => "CLOSED_FILE",
220    }
221  }
222  /// Creates an enum from field names used in the ProtoBuf definition.
223  pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
224    match value {
225      "FILE" => Some(Self::File),
226      "SYMLINK" => Some(Self::Symlink),
227      "DIR" => Some(Self::Dir),
228      "CLOSED_FILE" => Some(Self::ClosedFile),
229      _ => None,
230    }
231  }
232}