1#![recursion_limit = "100000000"]
5#![allow(bare_trait_objects)]
6#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies, clippy::all)]
7
8pub use self::errors::*;
9pub use self::types::*;
10
11pub mod types;
12
13#[doc(hidden)]
14pub mod dependencies {
15 pub use common as common;
16 pub use meta as meta;
17}
18
19pub mod services {
20 pub mod graph_storage_service {
21 #[derive(Clone, Debug)]
22 pub enum GetNeighborsExn {
23 #[doc(hidden)]
24 Success(crate::types::GetNeighborsResponse),
25 ApplicationException(::fbthrift::ApplicationException),
26 }
27
28 impl ::std::convert::From<crate::errors::graph_storage_service::GetNeighborsError> for GetNeighborsExn {
29 fn from(err: crate::errors::graph_storage_service::GetNeighborsError) -> Self {
30 match err {
31 crate::errors::graph_storage_service::GetNeighborsError::ApplicationException(aexn) => GetNeighborsExn::ApplicationException(aexn),
32 crate::errors::graph_storage_service::GetNeighborsError::ThriftError(err) => GetNeighborsExn::ApplicationException(::fbthrift::ApplicationException {
33 message: err.to_string(),
34 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
35 }),
36 }
37 }
38 }
39
40 impl ::std::convert::From<::fbthrift::ApplicationException> for GetNeighborsExn {
41 fn from(exn: ::fbthrift::ApplicationException) -> Self {
42 Self::ApplicationException(exn)
43 }
44 }
45
46 impl ::fbthrift::ExceptionInfo for GetNeighborsExn {
47 fn exn_name(&self) -> &'static str {
48 match self {
49 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
50 Self::ApplicationException(aexn) => aexn.exn_name(),
51 }
52 }
53
54 fn exn_value(&self) -> String {
55 match self {
56 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
57 Self::ApplicationException(aexn) => aexn.exn_value(),
58 }
59 }
60
61 fn exn_is_declared(&self) -> bool {
62 match self {
63 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
64 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
65 }
66 }
67 }
68
69 impl ::fbthrift::ResultInfo for GetNeighborsExn {
70 fn result_type(&self) -> ::fbthrift::ResultType {
71 match self {
72 Self::Success(_) => ::fbthrift::ResultType::Return,
73 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
74 }
75 }
76 }
77
78 impl ::fbthrift::GetTType for GetNeighborsExn {
79 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
80 }
81
82 impl<P> ::fbthrift::Serialize<P> for GetNeighborsExn
83 where
84 P: ::fbthrift::ProtocolWriter,
85 {
86 fn write(&self, p: &mut P) {
87 if let Self::ApplicationException(aexn) = self {
88 return aexn.write(p);
89 }
90 p.write_struct_begin("GetNeighbors");
91 match self {
92 Self::Success(inner) => {
93 p.write_field_begin(
94 "Success",
95 ::fbthrift::TType::Struct,
96 0i16,
97 );
98 inner.write(p);
99 p.write_field_end();
100 }
101 Self::ApplicationException(_aexn) => unreachable!(),
102 }
103 p.write_field_stop();
104 p.write_struct_end();
105 }
106 }
107
108 impl<P> ::fbthrift::Deserialize<P> for GetNeighborsExn
109 where
110 P: ::fbthrift::ProtocolReader,
111 {
112 fn read(p: &mut P) -> ::anyhow::Result<Self> {
113 static RETURNS: &[::fbthrift::Field] = &[
114 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
115 ];
116 let _ = p.read_struct_begin(|_| ())?;
117 let mut once = false;
118 let mut alt = ::std::option::Option::None;
119 loop {
120 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
121 match ((fty, fid as ::std::primitive::i32), once) {
122 ((::fbthrift::TType::Stop, _), _) => {
123 p.read_field_end()?;
124 break;
125 }
126 ((::fbthrift::TType::Struct, 0i32), false) => {
127 once = true;
128 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
129 }
130 ((ty, _id), false) => p.skip(ty)?,
131 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
132 ::fbthrift::ApplicationException::new(
133 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
134 format!(
135 "unwanted extra union {} field ty {:?} id {}",
136 "GetNeighborsExn",
137 badty,
138 badid,
139 ),
140 )
141 )),
142 }
143 p.read_field_end()?;
144 }
145 p.read_struct_end()?;
146 alt.ok_or_else(||
147 ::fbthrift::ApplicationException::new(
148 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
149 format!("Empty union {}", "GetNeighborsExn"),
150 )
151 .into(),
152 )
153 }
154 }
155
156 #[derive(Clone, Debug)]
157 pub enum GetDstBySrcExn {
158 #[doc(hidden)]
159 Success(crate::types::GetDstBySrcResponse),
160 ApplicationException(::fbthrift::ApplicationException),
161 }
162
163 impl ::std::convert::From<crate::errors::graph_storage_service::GetDstBySrcError> for GetDstBySrcExn {
164 fn from(err: crate::errors::graph_storage_service::GetDstBySrcError) -> Self {
165 match err {
166 crate::errors::graph_storage_service::GetDstBySrcError::ApplicationException(aexn) => GetDstBySrcExn::ApplicationException(aexn),
167 crate::errors::graph_storage_service::GetDstBySrcError::ThriftError(err) => GetDstBySrcExn::ApplicationException(::fbthrift::ApplicationException {
168 message: err.to_string(),
169 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
170 }),
171 }
172 }
173 }
174
175 impl ::std::convert::From<::fbthrift::ApplicationException> for GetDstBySrcExn {
176 fn from(exn: ::fbthrift::ApplicationException) -> Self {
177 Self::ApplicationException(exn)
178 }
179 }
180
181 impl ::fbthrift::ExceptionInfo for GetDstBySrcExn {
182 fn exn_name(&self) -> &'static str {
183 match self {
184 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
185 Self::ApplicationException(aexn) => aexn.exn_name(),
186 }
187 }
188
189 fn exn_value(&self) -> String {
190 match self {
191 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
192 Self::ApplicationException(aexn) => aexn.exn_value(),
193 }
194 }
195
196 fn exn_is_declared(&self) -> bool {
197 match self {
198 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
199 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
200 }
201 }
202 }
203
204 impl ::fbthrift::ResultInfo for GetDstBySrcExn {
205 fn result_type(&self) -> ::fbthrift::ResultType {
206 match self {
207 Self::Success(_) => ::fbthrift::ResultType::Return,
208 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
209 }
210 }
211 }
212
213 impl ::fbthrift::GetTType for GetDstBySrcExn {
214 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
215 }
216
217 impl<P> ::fbthrift::Serialize<P> for GetDstBySrcExn
218 where
219 P: ::fbthrift::ProtocolWriter,
220 {
221 fn write(&self, p: &mut P) {
222 if let Self::ApplicationException(aexn) = self {
223 return aexn.write(p);
224 }
225 p.write_struct_begin("GetDstBySrc");
226 match self {
227 Self::Success(inner) => {
228 p.write_field_begin(
229 "Success",
230 ::fbthrift::TType::Struct,
231 0i16,
232 );
233 inner.write(p);
234 p.write_field_end();
235 }
236 Self::ApplicationException(_aexn) => unreachable!(),
237 }
238 p.write_field_stop();
239 p.write_struct_end();
240 }
241 }
242
243 impl<P> ::fbthrift::Deserialize<P> for GetDstBySrcExn
244 where
245 P: ::fbthrift::ProtocolReader,
246 {
247 fn read(p: &mut P) -> ::anyhow::Result<Self> {
248 static RETURNS: &[::fbthrift::Field] = &[
249 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
250 ];
251 let _ = p.read_struct_begin(|_| ())?;
252 let mut once = false;
253 let mut alt = ::std::option::Option::None;
254 loop {
255 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
256 match ((fty, fid as ::std::primitive::i32), once) {
257 ((::fbthrift::TType::Stop, _), _) => {
258 p.read_field_end()?;
259 break;
260 }
261 ((::fbthrift::TType::Struct, 0i32), false) => {
262 once = true;
263 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
264 }
265 ((ty, _id), false) => p.skip(ty)?,
266 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
267 ::fbthrift::ApplicationException::new(
268 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
269 format!(
270 "unwanted extra union {} field ty {:?} id {}",
271 "GetDstBySrcExn",
272 badty,
273 badid,
274 ),
275 )
276 )),
277 }
278 p.read_field_end()?;
279 }
280 p.read_struct_end()?;
281 alt.ok_or_else(||
282 ::fbthrift::ApplicationException::new(
283 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
284 format!("Empty union {}", "GetDstBySrcExn"),
285 )
286 .into(),
287 )
288 }
289 }
290
291 #[derive(Clone, Debug)]
292 pub enum GetPropsExn {
293 #[doc(hidden)]
294 Success(crate::types::GetPropResponse),
295 ApplicationException(::fbthrift::ApplicationException),
296 }
297
298 impl ::std::convert::From<crate::errors::graph_storage_service::GetPropsError> for GetPropsExn {
299 fn from(err: crate::errors::graph_storage_service::GetPropsError) -> Self {
300 match err {
301 crate::errors::graph_storage_service::GetPropsError::ApplicationException(aexn) => GetPropsExn::ApplicationException(aexn),
302 crate::errors::graph_storage_service::GetPropsError::ThriftError(err) => GetPropsExn::ApplicationException(::fbthrift::ApplicationException {
303 message: err.to_string(),
304 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
305 }),
306 }
307 }
308 }
309
310 impl ::std::convert::From<::fbthrift::ApplicationException> for GetPropsExn {
311 fn from(exn: ::fbthrift::ApplicationException) -> Self {
312 Self::ApplicationException(exn)
313 }
314 }
315
316 impl ::fbthrift::ExceptionInfo for GetPropsExn {
317 fn exn_name(&self) -> &'static str {
318 match self {
319 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
320 Self::ApplicationException(aexn) => aexn.exn_name(),
321 }
322 }
323
324 fn exn_value(&self) -> String {
325 match self {
326 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
327 Self::ApplicationException(aexn) => aexn.exn_value(),
328 }
329 }
330
331 fn exn_is_declared(&self) -> bool {
332 match self {
333 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
334 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
335 }
336 }
337 }
338
339 impl ::fbthrift::ResultInfo for GetPropsExn {
340 fn result_type(&self) -> ::fbthrift::ResultType {
341 match self {
342 Self::Success(_) => ::fbthrift::ResultType::Return,
343 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
344 }
345 }
346 }
347
348 impl ::fbthrift::GetTType for GetPropsExn {
349 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
350 }
351
352 impl<P> ::fbthrift::Serialize<P> for GetPropsExn
353 where
354 P: ::fbthrift::ProtocolWriter,
355 {
356 fn write(&self, p: &mut P) {
357 if let Self::ApplicationException(aexn) = self {
358 return aexn.write(p);
359 }
360 p.write_struct_begin("GetProps");
361 match self {
362 Self::Success(inner) => {
363 p.write_field_begin(
364 "Success",
365 ::fbthrift::TType::Struct,
366 0i16,
367 );
368 inner.write(p);
369 p.write_field_end();
370 }
371 Self::ApplicationException(_aexn) => unreachable!(),
372 }
373 p.write_field_stop();
374 p.write_struct_end();
375 }
376 }
377
378 impl<P> ::fbthrift::Deserialize<P> for GetPropsExn
379 where
380 P: ::fbthrift::ProtocolReader,
381 {
382 fn read(p: &mut P) -> ::anyhow::Result<Self> {
383 static RETURNS: &[::fbthrift::Field] = &[
384 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
385 ];
386 let _ = p.read_struct_begin(|_| ())?;
387 let mut once = false;
388 let mut alt = ::std::option::Option::None;
389 loop {
390 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
391 match ((fty, fid as ::std::primitive::i32), once) {
392 ((::fbthrift::TType::Stop, _), _) => {
393 p.read_field_end()?;
394 break;
395 }
396 ((::fbthrift::TType::Struct, 0i32), false) => {
397 once = true;
398 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
399 }
400 ((ty, _id), false) => p.skip(ty)?,
401 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
402 ::fbthrift::ApplicationException::new(
403 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
404 format!(
405 "unwanted extra union {} field ty {:?} id {}",
406 "GetPropsExn",
407 badty,
408 badid,
409 ),
410 )
411 )),
412 }
413 p.read_field_end()?;
414 }
415 p.read_struct_end()?;
416 alt.ok_or_else(||
417 ::fbthrift::ApplicationException::new(
418 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
419 format!("Empty union {}", "GetPropsExn"),
420 )
421 .into(),
422 )
423 }
424 }
425
426 #[derive(Clone, Debug)]
427 pub enum AddVerticesExn {
428 #[doc(hidden)]
429 Success(crate::types::ExecResponse),
430 ApplicationException(::fbthrift::ApplicationException),
431 }
432
433 impl ::std::convert::From<crate::errors::graph_storage_service::AddVerticesError> for AddVerticesExn {
434 fn from(err: crate::errors::graph_storage_service::AddVerticesError) -> Self {
435 match err {
436 crate::errors::graph_storage_service::AddVerticesError::ApplicationException(aexn) => AddVerticesExn::ApplicationException(aexn),
437 crate::errors::graph_storage_service::AddVerticesError::ThriftError(err) => AddVerticesExn::ApplicationException(::fbthrift::ApplicationException {
438 message: err.to_string(),
439 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
440 }),
441 }
442 }
443 }
444
445 impl ::std::convert::From<::fbthrift::ApplicationException> for AddVerticesExn {
446 fn from(exn: ::fbthrift::ApplicationException) -> Self {
447 Self::ApplicationException(exn)
448 }
449 }
450
451 impl ::fbthrift::ExceptionInfo for AddVerticesExn {
452 fn exn_name(&self) -> &'static str {
453 match self {
454 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
455 Self::ApplicationException(aexn) => aexn.exn_name(),
456 }
457 }
458
459 fn exn_value(&self) -> String {
460 match self {
461 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
462 Self::ApplicationException(aexn) => aexn.exn_value(),
463 }
464 }
465
466 fn exn_is_declared(&self) -> bool {
467 match self {
468 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
469 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
470 }
471 }
472 }
473
474 impl ::fbthrift::ResultInfo for AddVerticesExn {
475 fn result_type(&self) -> ::fbthrift::ResultType {
476 match self {
477 Self::Success(_) => ::fbthrift::ResultType::Return,
478 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
479 }
480 }
481 }
482
483 impl ::fbthrift::GetTType for AddVerticesExn {
484 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
485 }
486
487 impl<P> ::fbthrift::Serialize<P> for AddVerticesExn
488 where
489 P: ::fbthrift::ProtocolWriter,
490 {
491 fn write(&self, p: &mut P) {
492 if let Self::ApplicationException(aexn) = self {
493 return aexn.write(p);
494 }
495 p.write_struct_begin("AddVertices");
496 match self {
497 Self::Success(inner) => {
498 p.write_field_begin(
499 "Success",
500 ::fbthrift::TType::Struct,
501 0i16,
502 );
503 inner.write(p);
504 p.write_field_end();
505 }
506 Self::ApplicationException(_aexn) => unreachable!(),
507 }
508 p.write_field_stop();
509 p.write_struct_end();
510 }
511 }
512
513 impl<P> ::fbthrift::Deserialize<P> for AddVerticesExn
514 where
515 P: ::fbthrift::ProtocolReader,
516 {
517 fn read(p: &mut P) -> ::anyhow::Result<Self> {
518 static RETURNS: &[::fbthrift::Field] = &[
519 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
520 ];
521 let _ = p.read_struct_begin(|_| ())?;
522 let mut once = false;
523 let mut alt = ::std::option::Option::None;
524 loop {
525 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
526 match ((fty, fid as ::std::primitive::i32), once) {
527 ((::fbthrift::TType::Stop, _), _) => {
528 p.read_field_end()?;
529 break;
530 }
531 ((::fbthrift::TType::Struct, 0i32), false) => {
532 once = true;
533 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
534 }
535 ((ty, _id), false) => p.skip(ty)?,
536 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
537 ::fbthrift::ApplicationException::new(
538 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
539 format!(
540 "unwanted extra union {} field ty {:?} id {}",
541 "AddVerticesExn",
542 badty,
543 badid,
544 ),
545 )
546 )),
547 }
548 p.read_field_end()?;
549 }
550 p.read_struct_end()?;
551 alt.ok_or_else(||
552 ::fbthrift::ApplicationException::new(
553 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
554 format!("Empty union {}", "AddVerticesExn"),
555 )
556 .into(),
557 )
558 }
559 }
560
561 #[derive(Clone, Debug)]
562 pub enum AddEdgesExn {
563 #[doc(hidden)]
564 Success(crate::types::ExecResponse),
565 ApplicationException(::fbthrift::ApplicationException),
566 }
567
568 impl ::std::convert::From<crate::errors::graph_storage_service::AddEdgesError> for AddEdgesExn {
569 fn from(err: crate::errors::graph_storage_service::AddEdgesError) -> Self {
570 match err {
571 crate::errors::graph_storage_service::AddEdgesError::ApplicationException(aexn) => AddEdgesExn::ApplicationException(aexn),
572 crate::errors::graph_storage_service::AddEdgesError::ThriftError(err) => AddEdgesExn::ApplicationException(::fbthrift::ApplicationException {
573 message: err.to_string(),
574 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
575 }),
576 }
577 }
578 }
579
580 impl ::std::convert::From<::fbthrift::ApplicationException> for AddEdgesExn {
581 fn from(exn: ::fbthrift::ApplicationException) -> Self {
582 Self::ApplicationException(exn)
583 }
584 }
585
586 impl ::fbthrift::ExceptionInfo for AddEdgesExn {
587 fn exn_name(&self) -> &'static str {
588 match self {
589 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
590 Self::ApplicationException(aexn) => aexn.exn_name(),
591 }
592 }
593
594 fn exn_value(&self) -> String {
595 match self {
596 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
597 Self::ApplicationException(aexn) => aexn.exn_value(),
598 }
599 }
600
601 fn exn_is_declared(&self) -> bool {
602 match self {
603 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
604 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
605 }
606 }
607 }
608
609 impl ::fbthrift::ResultInfo for AddEdgesExn {
610 fn result_type(&self) -> ::fbthrift::ResultType {
611 match self {
612 Self::Success(_) => ::fbthrift::ResultType::Return,
613 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
614 }
615 }
616 }
617
618 impl ::fbthrift::GetTType for AddEdgesExn {
619 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
620 }
621
622 impl<P> ::fbthrift::Serialize<P> for AddEdgesExn
623 where
624 P: ::fbthrift::ProtocolWriter,
625 {
626 fn write(&self, p: &mut P) {
627 if let Self::ApplicationException(aexn) = self {
628 return aexn.write(p);
629 }
630 p.write_struct_begin("AddEdges");
631 match self {
632 Self::Success(inner) => {
633 p.write_field_begin(
634 "Success",
635 ::fbthrift::TType::Struct,
636 0i16,
637 );
638 inner.write(p);
639 p.write_field_end();
640 }
641 Self::ApplicationException(_aexn) => unreachable!(),
642 }
643 p.write_field_stop();
644 p.write_struct_end();
645 }
646 }
647
648 impl<P> ::fbthrift::Deserialize<P> for AddEdgesExn
649 where
650 P: ::fbthrift::ProtocolReader,
651 {
652 fn read(p: &mut P) -> ::anyhow::Result<Self> {
653 static RETURNS: &[::fbthrift::Field] = &[
654 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
655 ];
656 let _ = p.read_struct_begin(|_| ())?;
657 let mut once = false;
658 let mut alt = ::std::option::Option::None;
659 loop {
660 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
661 match ((fty, fid as ::std::primitive::i32), once) {
662 ((::fbthrift::TType::Stop, _), _) => {
663 p.read_field_end()?;
664 break;
665 }
666 ((::fbthrift::TType::Struct, 0i32), false) => {
667 once = true;
668 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
669 }
670 ((ty, _id), false) => p.skip(ty)?,
671 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
672 ::fbthrift::ApplicationException::new(
673 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
674 format!(
675 "unwanted extra union {} field ty {:?} id {}",
676 "AddEdgesExn",
677 badty,
678 badid,
679 ),
680 )
681 )),
682 }
683 p.read_field_end()?;
684 }
685 p.read_struct_end()?;
686 alt.ok_or_else(||
687 ::fbthrift::ApplicationException::new(
688 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
689 format!("Empty union {}", "AddEdgesExn"),
690 )
691 .into(),
692 )
693 }
694 }
695
696 #[derive(Clone, Debug)]
697 pub enum DeleteEdgesExn {
698 #[doc(hidden)]
699 Success(crate::types::ExecResponse),
700 ApplicationException(::fbthrift::ApplicationException),
701 }
702
703 impl ::std::convert::From<crate::errors::graph_storage_service::DeleteEdgesError> for DeleteEdgesExn {
704 fn from(err: crate::errors::graph_storage_service::DeleteEdgesError) -> Self {
705 match err {
706 crate::errors::graph_storage_service::DeleteEdgesError::ApplicationException(aexn) => DeleteEdgesExn::ApplicationException(aexn),
707 crate::errors::graph_storage_service::DeleteEdgesError::ThriftError(err) => DeleteEdgesExn::ApplicationException(::fbthrift::ApplicationException {
708 message: err.to_string(),
709 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
710 }),
711 }
712 }
713 }
714
715 impl ::std::convert::From<::fbthrift::ApplicationException> for DeleteEdgesExn {
716 fn from(exn: ::fbthrift::ApplicationException) -> Self {
717 Self::ApplicationException(exn)
718 }
719 }
720
721 impl ::fbthrift::ExceptionInfo for DeleteEdgesExn {
722 fn exn_name(&self) -> &'static str {
723 match self {
724 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
725 Self::ApplicationException(aexn) => aexn.exn_name(),
726 }
727 }
728
729 fn exn_value(&self) -> String {
730 match self {
731 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
732 Self::ApplicationException(aexn) => aexn.exn_value(),
733 }
734 }
735
736 fn exn_is_declared(&self) -> bool {
737 match self {
738 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
739 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
740 }
741 }
742 }
743
744 impl ::fbthrift::ResultInfo for DeleteEdgesExn {
745 fn result_type(&self) -> ::fbthrift::ResultType {
746 match self {
747 Self::Success(_) => ::fbthrift::ResultType::Return,
748 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
749 }
750 }
751 }
752
753 impl ::fbthrift::GetTType for DeleteEdgesExn {
754 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
755 }
756
757 impl<P> ::fbthrift::Serialize<P> for DeleteEdgesExn
758 where
759 P: ::fbthrift::ProtocolWriter,
760 {
761 fn write(&self, p: &mut P) {
762 if let Self::ApplicationException(aexn) = self {
763 return aexn.write(p);
764 }
765 p.write_struct_begin("DeleteEdges");
766 match self {
767 Self::Success(inner) => {
768 p.write_field_begin(
769 "Success",
770 ::fbthrift::TType::Struct,
771 0i16,
772 );
773 inner.write(p);
774 p.write_field_end();
775 }
776 Self::ApplicationException(_aexn) => unreachable!(),
777 }
778 p.write_field_stop();
779 p.write_struct_end();
780 }
781 }
782
783 impl<P> ::fbthrift::Deserialize<P> for DeleteEdgesExn
784 where
785 P: ::fbthrift::ProtocolReader,
786 {
787 fn read(p: &mut P) -> ::anyhow::Result<Self> {
788 static RETURNS: &[::fbthrift::Field] = &[
789 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
790 ];
791 let _ = p.read_struct_begin(|_| ())?;
792 let mut once = false;
793 let mut alt = ::std::option::Option::None;
794 loop {
795 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
796 match ((fty, fid as ::std::primitive::i32), once) {
797 ((::fbthrift::TType::Stop, _), _) => {
798 p.read_field_end()?;
799 break;
800 }
801 ((::fbthrift::TType::Struct, 0i32), false) => {
802 once = true;
803 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
804 }
805 ((ty, _id), false) => p.skip(ty)?,
806 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
807 ::fbthrift::ApplicationException::new(
808 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
809 format!(
810 "unwanted extra union {} field ty {:?} id {}",
811 "DeleteEdgesExn",
812 badty,
813 badid,
814 ),
815 )
816 )),
817 }
818 p.read_field_end()?;
819 }
820 p.read_struct_end()?;
821 alt.ok_or_else(||
822 ::fbthrift::ApplicationException::new(
823 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
824 format!("Empty union {}", "DeleteEdgesExn"),
825 )
826 .into(),
827 )
828 }
829 }
830
831 #[derive(Clone, Debug)]
832 pub enum DeleteVerticesExn {
833 #[doc(hidden)]
834 Success(crate::types::ExecResponse),
835 ApplicationException(::fbthrift::ApplicationException),
836 }
837
838 impl ::std::convert::From<crate::errors::graph_storage_service::DeleteVerticesError> for DeleteVerticesExn {
839 fn from(err: crate::errors::graph_storage_service::DeleteVerticesError) -> Self {
840 match err {
841 crate::errors::graph_storage_service::DeleteVerticesError::ApplicationException(aexn) => DeleteVerticesExn::ApplicationException(aexn),
842 crate::errors::graph_storage_service::DeleteVerticesError::ThriftError(err) => DeleteVerticesExn::ApplicationException(::fbthrift::ApplicationException {
843 message: err.to_string(),
844 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
845 }),
846 }
847 }
848 }
849
850 impl ::std::convert::From<::fbthrift::ApplicationException> for DeleteVerticesExn {
851 fn from(exn: ::fbthrift::ApplicationException) -> Self {
852 Self::ApplicationException(exn)
853 }
854 }
855
856 impl ::fbthrift::ExceptionInfo for DeleteVerticesExn {
857 fn exn_name(&self) -> &'static str {
858 match self {
859 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
860 Self::ApplicationException(aexn) => aexn.exn_name(),
861 }
862 }
863
864 fn exn_value(&self) -> String {
865 match self {
866 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
867 Self::ApplicationException(aexn) => aexn.exn_value(),
868 }
869 }
870
871 fn exn_is_declared(&self) -> bool {
872 match self {
873 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
874 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
875 }
876 }
877 }
878
879 impl ::fbthrift::ResultInfo for DeleteVerticesExn {
880 fn result_type(&self) -> ::fbthrift::ResultType {
881 match self {
882 Self::Success(_) => ::fbthrift::ResultType::Return,
883 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
884 }
885 }
886 }
887
888 impl ::fbthrift::GetTType for DeleteVerticesExn {
889 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
890 }
891
892 impl<P> ::fbthrift::Serialize<P> for DeleteVerticesExn
893 where
894 P: ::fbthrift::ProtocolWriter,
895 {
896 fn write(&self, p: &mut P) {
897 if let Self::ApplicationException(aexn) = self {
898 return aexn.write(p);
899 }
900 p.write_struct_begin("DeleteVertices");
901 match self {
902 Self::Success(inner) => {
903 p.write_field_begin(
904 "Success",
905 ::fbthrift::TType::Struct,
906 0i16,
907 );
908 inner.write(p);
909 p.write_field_end();
910 }
911 Self::ApplicationException(_aexn) => unreachable!(),
912 }
913 p.write_field_stop();
914 p.write_struct_end();
915 }
916 }
917
918 impl<P> ::fbthrift::Deserialize<P> for DeleteVerticesExn
919 where
920 P: ::fbthrift::ProtocolReader,
921 {
922 fn read(p: &mut P) -> ::anyhow::Result<Self> {
923 static RETURNS: &[::fbthrift::Field] = &[
924 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
925 ];
926 let _ = p.read_struct_begin(|_| ())?;
927 let mut once = false;
928 let mut alt = ::std::option::Option::None;
929 loop {
930 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
931 match ((fty, fid as ::std::primitive::i32), once) {
932 ((::fbthrift::TType::Stop, _), _) => {
933 p.read_field_end()?;
934 break;
935 }
936 ((::fbthrift::TType::Struct, 0i32), false) => {
937 once = true;
938 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
939 }
940 ((ty, _id), false) => p.skip(ty)?,
941 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
942 ::fbthrift::ApplicationException::new(
943 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
944 format!(
945 "unwanted extra union {} field ty {:?} id {}",
946 "DeleteVerticesExn",
947 badty,
948 badid,
949 ),
950 )
951 )),
952 }
953 p.read_field_end()?;
954 }
955 p.read_struct_end()?;
956 alt.ok_or_else(||
957 ::fbthrift::ApplicationException::new(
958 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
959 format!("Empty union {}", "DeleteVerticesExn"),
960 )
961 .into(),
962 )
963 }
964 }
965
966 #[derive(Clone, Debug)]
967 pub enum DeleteTagsExn {
968 #[doc(hidden)]
969 Success(crate::types::ExecResponse),
970 ApplicationException(::fbthrift::ApplicationException),
971 }
972
973 impl ::std::convert::From<crate::errors::graph_storage_service::DeleteTagsError> for DeleteTagsExn {
974 fn from(err: crate::errors::graph_storage_service::DeleteTagsError) -> Self {
975 match err {
976 crate::errors::graph_storage_service::DeleteTagsError::ApplicationException(aexn) => DeleteTagsExn::ApplicationException(aexn),
977 crate::errors::graph_storage_service::DeleteTagsError::ThriftError(err) => DeleteTagsExn::ApplicationException(::fbthrift::ApplicationException {
978 message: err.to_string(),
979 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
980 }),
981 }
982 }
983 }
984
985 impl ::std::convert::From<::fbthrift::ApplicationException> for DeleteTagsExn {
986 fn from(exn: ::fbthrift::ApplicationException) -> Self {
987 Self::ApplicationException(exn)
988 }
989 }
990
991 impl ::fbthrift::ExceptionInfo for DeleteTagsExn {
992 fn exn_name(&self) -> &'static str {
993 match self {
994 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
995 Self::ApplicationException(aexn) => aexn.exn_name(),
996 }
997 }
998
999 fn exn_value(&self) -> String {
1000 match self {
1001 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1002 Self::ApplicationException(aexn) => aexn.exn_value(),
1003 }
1004 }
1005
1006 fn exn_is_declared(&self) -> bool {
1007 match self {
1008 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1009 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1010 }
1011 }
1012 }
1013
1014 impl ::fbthrift::ResultInfo for DeleteTagsExn {
1015 fn result_type(&self) -> ::fbthrift::ResultType {
1016 match self {
1017 Self::Success(_) => ::fbthrift::ResultType::Return,
1018 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1019 }
1020 }
1021 }
1022
1023 impl ::fbthrift::GetTType for DeleteTagsExn {
1024 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1025 }
1026
1027 impl<P> ::fbthrift::Serialize<P> for DeleteTagsExn
1028 where
1029 P: ::fbthrift::ProtocolWriter,
1030 {
1031 fn write(&self, p: &mut P) {
1032 if let Self::ApplicationException(aexn) = self {
1033 return aexn.write(p);
1034 }
1035 p.write_struct_begin("DeleteTags");
1036 match self {
1037 Self::Success(inner) => {
1038 p.write_field_begin(
1039 "Success",
1040 ::fbthrift::TType::Struct,
1041 0i16,
1042 );
1043 inner.write(p);
1044 p.write_field_end();
1045 }
1046 Self::ApplicationException(_aexn) => unreachable!(),
1047 }
1048 p.write_field_stop();
1049 p.write_struct_end();
1050 }
1051 }
1052
1053 impl<P> ::fbthrift::Deserialize<P> for DeleteTagsExn
1054 where
1055 P: ::fbthrift::ProtocolReader,
1056 {
1057 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1058 static RETURNS: &[::fbthrift::Field] = &[
1059 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1060 ];
1061 let _ = p.read_struct_begin(|_| ())?;
1062 let mut once = false;
1063 let mut alt = ::std::option::Option::None;
1064 loop {
1065 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1066 match ((fty, fid as ::std::primitive::i32), once) {
1067 ((::fbthrift::TType::Stop, _), _) => {
1068 p.read_field_end()?;
1069 break;
1070 }
1071 ((::fbthrift::TType::Struct, 0i32), false) => {
1072 once = true;
1073 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1074 }
1075 ((ty, _id), false) => p.skip(ty)?,
1076 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1077 ::fbthrift::ApplicationException::new(
1078 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1079 format!(
1080 "unwanted extra union {} field ty {:?} id {}",
1081 "DeleteTagsExn",
1082 badty,
1083 badid,
1084 ),
1085 )
1086 )),
1087 }
1088 p.read_field_end()?;
1089 }
1090 p.read_struct_end()?;
1091 alt.ok_or_else(||
1092 ::fbthrift::ApplicationException::new(
1093 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1094 format!("Empty union {}", "DeleteTagsExn"),
1095 )
1096 .into(),
1097 )
1098 }
1099 }
1100
1101 #[derive(Clone, Debug)]
1102 pub enum UpdateVertexExn {
1103 #[doc(hidden)]
1104 Success(crate::types::UpdateResponse),
1105 ApplicationException(::fbthrift::ApplicationException),
1106 }
1107
1108 impl ::std::convert::From<crate::errors::graph_storage_service::UpdateVertexError> for UpdateVertexExn {
1109 fn from(err: crate::errors::graph_storage_service::UpdateVertexError) -> Self {
1110 match err {
1111 crate::errors::graph_storage_service::UpdateVertexError::ApplicationException(aexn) => UpdateVertexExn::ApplicationException(aexn),
1112 crate::errors::graph_storage_service::UpdateVertexError::ThriftError(err) => UpdateVertexExn::ApplicationException(::fbthrift::ApplicationException {
1113 message: err.to_string(),
1114 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1115 }),
1116 }
1117 }
1118 }
1119
1120 impl ::std::convert::From<::fbthrift::ApplicationException> for UpdateVertexExn {
1121 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1122 Self::ApplicationException(exn)
1123 }
1124 }
1125
1126 impl ::fbthrift::ExceptionInfo for UpdateVertexExn {
1127 fn exn_name(&self) -> &'static str {
1128 match self {
1129 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1130 Self::ApplicationException(aexn) => aexn.exn_name(),
1131 }
1132 }
1133
1134 fn exn_value(&self) -> String {
1135 match self {
1136 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1137 Self::ApplicationException(aexn) => aexn.exn_value(),
1138 }
1139 }
1140
1141 fn exn_is_declared(&self) -> bool {
1142 match self {
1143 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1144 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1145 }
1146 }
1147 }
1148
1149 impl ::fbthrift::ResultInfo for UpdateVertexExn {
1150 fn result_type(&self) -> ::fbthrift::ResultType {
1151 match self {
1152 Self::Success(_) => ::fbthrift::ResultType::Return,
1153 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1154 }
1155 }
1156 }
1157
1158 impl ::fbthrift::GetTType for UpdateVertexExn {
1159 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1160 }
1161
1162 impl<P> ::fbthrift::Serialize<P> for UpdateVertexExn
1163 where
1164 P: ::fbthrift::ProtocolWriter,
1165 {
1166 fn write(&self, p: &mut P) {
1167 if let Self::ApplicationException(aexn) = self {
1168 return aexn.write(p);
1169 }
1170 p.write_struct_begin("UpdateVertex");
1171 match self {
1172 Self::Success(inner) => {
1173 p.write_field_begin(
1174 "Success",
1175 ::fbthrift::TType::Struct,
1176 0i16,
1177 );
1178 inner.write(p);
1179 p.write_field_end();
1180 }
1181 Self::ApplicationException(_aexn) => unreachable!(),
1182 }
1183 p.write_field_stop();
1184 p.write_struct_end();
1185 }
1186 }
1187
1188 impl<P> ::fbthrift::Deserialize<P> for UpdateVertexExn
1189 where
1190 P: ::fbthrift::ProtocolReader,
1191 {
1192 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1193 static RETURNS: &[::fbthrift::Field] = &[
1194 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1195 ];
1196 let _ = p.read_struct_begin(|_| ())?;
1197 let mut once = false;
1198 let mut alt = ::std::option::Option::None;
1199 loop {
1200 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1201 match ((fty, fid as ::std::primitive::i32), once) {
1202 ((::fbthrift::TType::Stop, _), _) => {
1203 p.read_field_end()?;
1204 break;
1205 }
1206 ((::fbthrift::TType::Struct, 0i32), false) => {
1207 once = true;
1208 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1209 }
1210 ((ty, _id), false) => p.skip(ty)?,
1211 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1212 ::fbthrift::ApplicationException::new(
1213 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1214 format!(
1215 "unwanted extra union {} field ty {:?} id {}",
1216 "UpdateVertexExn",
1217 badty,
1218 badid,
1219 ),
1220 )
1221 )),
1222 }
1223 p.read_field_end()?;
1224 }
1225 p.read_struct_end()?;
1226 alt.ok_or_else(||
1227 ::fbthrift::ApplicationException::new(
1228 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1229 format!("Empty union {}", "UpdateVertexExn"),
1230 )
1231 .into(),
1232 )
1233 }
1234 }
1235
1236 #[derive(Clone, Debug)]
1237 pub enum UpdateEdgeExn {
1238 #[doc(hidden)]
1239 Success(crate::types::UpdateResponse),
1240 ApplicationException(::fbthrift::ApplicationException),
1241 }
1242
1243 impl ::std::convert::From<crate::errors::graph_storage_service::UpdateEdgeError> for UpdateEdgeExn {
1244 fn from(err: crate::errors::graph_storage_service::UpdateEdgeError) -> Self {
1245 match err {
1246 crate::errors::graph_storage_service::UpdateEdgeError::ApplicationException(aexn) => UpdateEdgeExn::ApplicationException(aexn),
1247 crate::errors::graph_storage_service::UpdateEdgeError::ThriftError(err) => UpdateEdgeExn::ApplicationException(::fbthrift::ApplicationException {
1248 message: err.to_string(),
1249 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1250 }),
1251 }
1252 }
1253 }
1254
1255 impl ::std::convert::From<::fbthrift::ApplicationException> for UpdateEdgeExn {
1256 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1257 Self::ApplicationException(exn)
1258 }
1259 }
1260
1261 impl ::fbthrift::ExceptionInfo for UpdateEdgeExn {
1262 fn exn_name(&self) -> &'static str {
1263 match self {
1264 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1265 Self::ApplicationException(aexn) => aexn.exn_name(),
1266 }
1267 }
1268
1269 fn exn_value(&self) -> String {
1270 match self {
1271 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1272 Self::ApplicationException(aexn) => aexn.exn_value(),
1273 }
1274 }
1275
1276 fn exn_is_declared(&self) -> bool {
1277 match self {
1278 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1279 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1280 }
1281 }
1282 }
1283
1284 impl ::fbthrift::ResultInfo for UpdateEdgeExn {
1285 fn result_type(&self) -> ::fbthrift::ResultType {
1286 match self {
1287 Self::Success(_) => ::fbthrift::ResultType::Return,
1288 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1289 }
1290 }
1291 }
1292
1293 impl ::fbthrift::GetTType for UpdateEdgeExn {
1294 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1295 }
1296
1297 impl<P> ::fbthrift::Serialize<P> for UpdateEdgeExn
1298 where
1299 P: ::fbthrift::ProtocolWriter,
1300 {
1301 fn write(&self, p: &mut P) {
1302 if let Self::ApplicationException(aexn) = self {
1303 return aexn.write(p);
1304 }
1305 p.write_struct_begin("UpdateEdge");
1306 match self {
1307 Self::Success(inner) => {
1308 p.write_field_begin(
1309 "Success",
1310 ::fbthrift::TType::Struct,
1311 0i16,
1312 );
1313 inner.write(p);
1314 p.write_field_end();
1315 }
1316 Self::ApplicationException(_aexn) => unreachable!(),
1317 }
1318 p.write_field_stop();
1319 p.write_struct_end();
1320 }
1321 }
1322
1323 impl<P> ::fbthrift::Deserialize<P> for UpdateEdgeExn
1324 where
1325 P: ::fbthrift::ProtocolReader,
1326 {
1327 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1328 static RETURNS: &[::fbthrift::Field] = &[
1329 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1330 ];
1331 let _ = p.read_struct_begin(|_| ())?;
1332 let mut once = false;
1333 let mut alt = ::std::option::Option::None;
1334 loop {
1335 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1336 match ((fty, fid as ::std::primitive::i32), once) {
1337 ((::fbthrift::TType::Stop, _), _) => {
1338 p.read_field_end()?;
1339 break;
1340 }
1341 ((::fbthrift::TType::Struct, 0i32), false) => {
1342 once = true;
1343 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1344 }
1345 ((ty, _id), false) => p.skip(ty)?,
1346 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1347 ::fbthrift::ApplicationException::new(
1348 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1349 format!(
1350 "unwanted extra union {} field ty {:?} id {}",
1351 "UpdateEdgeExn",
1352 badty,
1353 badid,
1354 ),
1355 )
1356 )),
1357 }
1358 p.read_field_end()?;
1359 }
1360 p.read_struct_end()?;
1361 alt.ok_or_else(||
1362 ::fbthrift::ApplicationException::new(
1363 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1364 format!("Empty union {}", "UpdateEdgeExn"),
1365 )
1366 .into(),
1367 )
1368 }
1369 }
1370
1371 #[derive(Clone, Debug)]
1372 pub enum ScanVertexExn {
1373 #[doc(hidden)]
1374 Success(crate::types::ScanResponse),
1375 ApplicationException(::fbthrift::ApplicationException),
1376 }
1377
1378 impl ::std::convert::From<crate::errors::graph_storage_service::ScanVertexError> for ScanVertexExn {
1379 fn from(err: crate::errors::graph_storage_service::ScanVertexError) -> Self {
1380 match err {
1381 crate::errors::graph_storage_service::ScanVertexError::ApplicationException(aexn) => ScanVertexExn::ApplicationException(aexn),
1382 crate::errors::graph_storage_service::ScanVertexError::ThriftError(err) => ScanVertexExn::ApplicationException(::fbthrift::ApplicationException {
1383 message: err.to_string(),
1384 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1385 }),
1386 }
1387 }
1388 }
1389
1390 impl ::std::convert::From<::fbthrift::ApplicationException> for ScanVertexExn {
1391 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1392 Self::ApplicationException(exn)
1393 }
1394 }
1395
1396 impl ::fbthrift::ExceptionInfo for ScanVertexExn {
1397 fn exn_name(&self) -> &'static str {
1398 match self {
1399 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1400 Self::ApplicationException(aexn) => aexn.exn_name(),
1401 }
1402 }
1403
1404 fn exn_value(&self) -> String {
1405 match self {
1406 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1407 Self::ApplicationException(aexn) => aexn.exn_value(),
1408 }
1409 }
1410
1411 fn exn_is_declared(&self) -> bool {
1412 match self {
1413 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1414 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1415 }
1416 }
1417 }
1418
1419 impl ::fbthrift::ResultInfo for ScanVertexExn {
1420 fn result_type(&self) -> ::fbthrift::ResultType {
1421 match self {
1422 Self::Success(_) => ::fbthrift::ResultType::Return,
1423 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1424 }
1425 }
1426 }
1427
1428 impl ::fbthrift::GetTType for ScanVertexExn {
1429 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1430 }
1431
1432 impl<P> ::fbthrift::Serialize<P> for ScanVertexExn
1433 where
1434 P: ::fbthrift::ProtocolWriter,
1435 {
1436 fn write(&self, p: &mut P) {
1437 if let Self::ApplicationException(aexn) = self {
1438 return aexn.write(p);
1439 }
1440 p.write_struct_begin("ScanVertex");
1441 match self {
1442 Self::Success(inner) => {
1443 p.write_field_begin(
1444 "Success",
1445 ::fbthrift::TType::Struct,
1446 0i16,
1447 );
1448 inner.write(p);
1449 p.write_field_end();
1450 }
1451 Self::ApplicationException(_aexn) => unreachable!(),
1452 }
1453 p.write_field_stop();
1454 p.write_struct_end();
1455 }
1456 }
1457
1458 impl<P> ::fbthrift::Deserialize<P> for ScanVertexExn
1459 where
1460 P: ::fbthrift::ProtocolReader,
1461 {
1462 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1463 static RETURNS: &[::fbthrift::Field] = &[
1464 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1465 ];
1466 let _ = p.read_struct_begin(|_| ())?;
1467 let mut once = false;
1468 let mut alt = ::std::option::Option::None;
1469 loop {
1470 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1471 match ((fty, fid as ::std::primitive::i32), once) {
1472 ((::fbthrift::TType::Stop, _), _) => {
1473 p.read_field_end()?;
1474 break;
1475 }
1476 ((::fbthrift::TType::Struct, 0i32), false) => {
1477 once = true;
1478 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1479 }
1480 ((ty, _id), false) => p.skip(ty)?,
1481 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1482 ::fbthrift::ApplicationException::new(
1483 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1484 format!(
1485 "unwanted extra union {} field ty {:?} id {}",
1486 "ScanVertexExn",
1487 badty,
1488 badid,
1489 ),
1490 )
1491 )),
1492 }
1493 p.read_field_end()?;
1494 }
1495 p.read_struct_end()?;
1496 alt.ok_or_else(||
1497 ::fbthrift::ApplicationException::new(
1498 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1499 format!("Empty union {}", "ScanVertexExn"),
1500 )
1501 .into(),
1502 )
1503 }
1504 }
1505
1506 #[derive(Clone, Debug)]
1507 pub enum ScanEdgeExn {
1508 #[doc(hidden)]
1509 Success(crate::types::ScanResponse),
1510 ApplicationException(::fbthrift::ApplicationException),
1511 }
1512
1513 impl ::std::convert::From<crate::errors::graph_storage_service::ScanEdgeError> for ScanEdgeExn {
1514 fn from(err: crate::errors::graph_storage_service::ScanEdgeError) -> Self {
1515 match err {
1516 crate::errors::graph_storage_service::ScanEdgeError::ApplicationException(aexn) => ScanEdgeExn::ApplicationException(aexn),
1517 crate::errors::graph_storage_service::ScanEdgeError::ThriftError(err) => ScanEdgeExn::ApplicationException(::fbthrift::ApplicationException {
1518 message: err.to_string(),
1519 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1520 }),
1521 }
1522 }
1523 }
1524
1525 impl ::std::convert::From<::fbthrift::ApplicationException> for ScanEdgeExn {
1526 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1527 Self::ApplicationException(exn)
1528 }
1529 }
1530
1531 impl ::fbthrift::ExceptionInfo for ScanEdgeExn {
1532 fn exn_name(&self) -> &'static str {
1533 match self {
1534 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1535 Self::ApplicationException(aexn) => aexn.exn_name(),
1536 }
1537 }
1538
1539 fn exn_value(&self) -> String {
1540 match self {
1541 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1542 Self::ApplicationException(aexn) => aexn.exn_value(),
1543 }
1544 }
1545
1546 fn exn_is_declared(&self) -> bool {
1547 match self {
1548 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1549 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1550 }
1551 }
1552 }
1553
1554 impl ::fbthrift::ResultInfo for ScanEdgeExn {
1555 fn result_type(&self) -> ::fbthrift::ResultType {
1556 match self {
1557 Self::Success(_) => ::fbthrift::ResultType::Return,
1558 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1559 }
1560 }
1561 }
1562
1563 impl ::fbthrift::GetTType for ScanEdgeExn {
1564 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1565 }
1566
1567 impl<P> ::fbthrift::Serialize<P> for ScanEdgeExn
1568 where
1569 P: ::fbthrift::ProtocolWriter,
1570 {
1571 fn write(&self, p: &mut P) {
1572 if let Self::ApplicationException(aexn) = self {
1573 return aexn.write(p);
1574 }
1575 p.write_struct_begin("ScanEdge");
1576 match self {
1577 Self::Success(inner) => {
1578 p.write_field_begin(
1579 "Success",
1580 ::fbthrift::TType::Struct,
1581 0i16,
1582 );
1583 inner.write(p);
1584 p.write_field_end();
1585 }
1586 Self::ApplicationException(_aexn) => unreachable!(),
1587 }
1588 p.write_field_stop();
1589 p.write_struct_end();
1590 }
1591 }
1592
1593 impl<P> ::fbthrift::Deserialize<P> for ScanEdgeExn
1594 where
1595 P: ::fbthrift::ProtocolReader,
1596 {
1597 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1598 static RETURNS: &[::fbthrift::Field] = &[
1599 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1600 ];
1601 let _ = p.read_struct_begin(|_| ())?;
1602 let mut once = false;
1603 let mut alt = ::std::option::Option::None;
1604 loop {
1605 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1606 match ((fty, fid as ::std::primitive::i32), once) {
1607 ((::fbthrift::TType::Stop, _), _) => {
1608 p.read_field_end()?;
1609 break;
1610 }
1611 ((::fbthrift::TType::Struct, 0i32), false) => {
1612 once = true;
1613 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1614 }
1615 ((ty, _id), false) => p.skip(ty)?,
1616 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1617 ::fbthrift::ApplicationException::new(
1618 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1619 format!(
1620 "unwanted extra union {} field ty {:?} id {}",
1621 "ScanEdgeExn",
1622 badty,
1623 badid,
1624 ),
1625 )
1626 )),
1627 }
1628 p.read_field_end()?;
1629 }
1630 p.read_struct_end()?;
1631 alt.ok_or_else(||
1632 ::fbthrift::ApplicationException::new(
1633 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1634 format!("Empty union {}", "ScanEdgeExn"),
1635 )
1636 .into(),
1637 )
1638 }
1639 }
1640
1641 #[derive(Clone, Debug)]
1642 pub enum GetUUIDExn {
1643 #[doc(hidden)]
1644 Success(crate::types::GetUUIDResp),
1645 ApplicationException(::fbthrift::ApplicationException),
1646 }
1647
1648 impl ::std::convert::From<crate::errors::graph_storage_service::GetUUIDError> for GetUUIDExn {
1649 fn from(err: crate::errors::graph_storage_service::GetUUIDError) -> Self {
1650 match err {
1651 crate::errors::graph_storage_service::GetUUIDError::ApplicationException(aexn) => GetUUIDExn::ApplicationException(aexn),
1652 crate::errors::graph_storage_service::GetUUIDError::ThriftError(err) => GetUUIDExn::ApplicationException(::fbthrift::ApplicationException {
1653 message: err.to_string(),
1654 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1655 }),
1656 }
1657 }
1658 }
1659
1660 impl ::std::convert::From<::fbthrift::ApplicationException> for GetUUIDExn {
1661 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1662 Self::ApplicationException(exn)
1663 }
1664 }
1665
1666 impl ::fbthrift::ExceptionInfo for GetUUIDExn {
1667 fn exn_name(&self) -> &'static str {
1668 match self {
1669 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1670 Self::ApplicationException(aexn) => aexn.exn_name(),
1671 }
1672 }
1673
1674 fn exn_value(&self) -> String {
1675 match self {
1676 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1677 Self::ApplicationException(aexn) => aexn.exn_value(),
1678 }
1679 }
1680
1681 fn exn_is_declared(&self) -> bool {
1682 match self {
1683 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1684 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1685 }
1686 }
1687 }
1688
1689 impl ::fbthrift::ResultInfo for GetUUIDExn {
1690 fn result_type(&self) -> ::fbthrift::ResultType {
1691 match self {
1692 Self::Success(_) => ::fbthrift::ResultType::Return,
1693 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1694 }
1695 }
1696 }
1697
1698 impl ::fbthrift::GetTType for GetUUIDExn {
1699 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1700 }
1701
1702 impl<P> ::fbthrift::Serialize<P> for GetUUIDExn
1703 where
1704 P: ::fbthrift::ProtocolWriter,
1705 {
1706 fn write(&self, p: &mut P) {
1707 if let Self::ApplicationException(aexn) = self {
1708 return aexn.write(p);
1709 }
1710 p.write_struct_begin("GetUUID");
1711 match self {
1712 Self::Success(inner) => {
1713 p.write_field_begin(
1714 "Success",
1715 ::fbthrift::TType::Struct,
1716 0i16,
1717 );
1718 inner.write(p);
1719 p.write_field_end();
1720 }
1721 Self::ApplicationException(_aexn) => unreachable!(),
1722 }
1723 p.write_field_stop();
1724 p.write_struct_end();
1725 }
1726 }
1727
1728 impl<P> ::fbthrift::Deserialize<P> for GetUUIDExn
1729 where
1730 P: ::fbthrift::ProtocolReader,
1731 {
1732 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1733 static RETURNS: &[::fbthrift::Field] = &[
1734 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1735 ];
1736 let _ = p.read_struct_begin(|_| ())?;
1737 let mut once = false;
1738 let mut alt = ::std::option::Option::None;
1739 loop {
1740 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1741 match ((fty, fid as ::std::primitive::i32), once) {
1742 ((::fbthrift::TType::Stop, _), _) => {
1743 p.read_field_end()?;
1744 break;
1745 }
1746 ((::fbthrift::TType::Struct, 0i32), false) => {
1747 once = true;
1748 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1749 }
1750 ((ty, _id), false) => p.skip(ty)?,
1751 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1752 ::fbthrift::ApplicationException::new(
1753 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1754 format!(
1755 "unwanted extra union {} field ty {:?} id {}",
1756 "GetUUIDExn",
1757 badty,
1758 badid,
1759 ),
1760 )
1761 )),
1762 }
1763 p.read_field_end()?;
1764 }
1765 p.read_struct_end()?;
1766 alt.ok_or_else(||
1767 ::fbthrift::ApplicationException::new(
1768 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1769 format!("Empty union {}", "GetUUIDExn"),
1770 )
1771 .into(),
1772 )
1773 }
1774 }
1775
1776 #[derive(Clone, Debug)]
1777 pub enum LookupIndexExn {
1778 #[doc(hidden)]
1779 Success(crate::types::LookupIndexResp),
1780 ApplicationException(::fbthrift::ApplicationException),
1781 }
1782
1783 impl ::std::convert::From<crate::errors::graph_storage_service::LookupIndexError> for LookupIndexExn {
1784 fn from(err: crate::errors::graph_storage_service::LookupIndexError) -> Self {
1785 match err {
1786 crate::errors::graph_storage_service::LookupIndexError::ApplicationException(aexn) => LookupIndexExn::ApplicationException(aexn),
1787 crate::errors::graph_storage_service::LookupIndexError::ThriftError(err) => LookupIndexExn::ApplicationException(::fbthrift::ApplicationException {
1788 message: err.to_string(),
1789 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1790 }),
1791 }
1792 }
1793 }
1794
1795 impl ::std::convert::From<::fbthrift::ApplicationException> for LookupIndexExn {
1796 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1797 Self::ApplicationException(exn)
1798 }
1799 }
1800
1801 impl ::fbthrift::ExceptionInfo for LookupIndexExn {
1802 fn exn_name(&self) -> &'static str {
1803 match self {
1804 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1805 Self::ApplicationException(aexn) => aexn.exn_name(),
1806 }
1807 }
1808
1809 fn exn_value(&self) -> String {
1810 match self {
1811 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1812 Self::ApplicationException(aexn) => aexn.exn_value(),
1813 }
1814 }
1815
1816 fn exn_is_declared(&self) -> bool {
1817 match self {
1818 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1819 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1820 }
1821 }
1822 }
1823
1824 impl ::fbthrift::ResultInfo for LookupIndexExn {
1825 fn result_type(&self) -> ::fbthrift::ResultType {
1826 match self {
1827 Self::Success(_) => ::fbthrift::ResultType::Return,
1828 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1829 }
1830 }
1831 }
1832
1833 impl ::fbthrift::GetTType for LookupIndexExn {
1834 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1835 }
1836
1837 impl<P> ::fbthrift::Serialize<P> for LookupIndexExn
1838 where
1839 P: ::fbthrift::ProtocolWriter,
1840 {
1841 fn write(&self, p: &mut P) {
1842 if let Self::ApplicationException(aexn) = self {
1843 return aexn.write(p);
1844 }
1845 p.write_struct_begin("LookupIndex");
1846 match self {
1847 Self::Success(inner) => {
1848 p.write_field_begin(
1849 "Success",
1850 ::fbthrift::TType::Struct,
1851 0i16,
1852 );
1853 inner.write(p);
1854 p.write_field_end();
1855 }
1856 Self::ApplicationException(_aexn) => unreachable!(),
1857 }
1858 p.write_field_stop();
1859 p.write_struct_end();
1860 }
1861 }
1862
1863 impl<P> ::fbthrift::Deserialize<P> for LookupIndexExn
1864 where
1865 P: ::fbthrift::ProtocolReader,
1866 {
1867 fn read(p: &mut P) -> ::anyhow::Result<Self> {
1868 static RETURNS: &[::fbthrift::Field] = &[
1869 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
1870 ];
1871 let _ = p.read_struct_begin(|_| ())?;
1872 let mut once = false;
1873 let mut alt = ::std::option::Option::None;
1874 loop {
1875 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
1876 match ((fty, fid as ::std::primitive::i32), once) {
1877 ((::fbthrift::TType::Stop, _), _) => {
1878 p.read_field_end()?;
1879 break;
1880 }
1881 ((::fbthrift::TType::Struct, 0i32), false) => {
1882 once = true;
1883 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
1884 }
1885 ((ty, _id), false) => p.skip(ty)?,
1886 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
1887 ::fbthrift::ApplicationException::new(
1888 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
1889 format!(
1890 "unwanted extra union {} field ty {:?} id {}",
1891 "LookupIndexExn",
1892 badty,
1893 badid,
1894 ),
1895 )
1896 )),
1897 }
1898 p.read_field_end()?;
1899 }
1900 p.read_struct_end()?;
1901 alt.ok_or_else(||
1902 ::fbthrift::ApplicationException::new(
1903 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
1904 format!("Empty union {}", "LookupIndexExn"),
1905 )
1906 .into(),
1907 )
1908 }
1909 }
1910
1911 #[derive(Clone, Debug)]
1912 pub enum LookupAndTraverseExn {
1913 #[doc(hidden)]
1914 Success(crate::types::GetNeighborsResponse),
1915 ApplicationException(::fbthrift::ApplicationException),
1916 }
1917
1918 impl ::std::convert::From<crate::errors::graph_storage_service::LookupAndTraverseError> for LookupAndTraverseExn {
1919 fn from(err: crate::errors::graph_storage_service::LookupAndTraverseError) -> Self {
1920 match err {
1921 crate::errors::graph_storage_service::LookupAndTraverseError::ApplicationException(aexn) => LookupAndTraverseExn::ApplicationException(aexn),
1922 crate::errors::graph_storage_service::LookupAndTraverseError::ThriftError(err) => LookupAndTraverseExn::ApplicationException(::fbthrift::ApplicationException {
1923 message: err.to_string(),
1924 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
1925 }),
1926 }
1927 }
1928 }
1929
1930 impl ::std::convert::From<::fbthrift::ApplicationException> for LookupAndTraverseExn {
1931 fn from(exn: ::fbthrift::ApplicationException) -> Self {
1932 Self::ApplicationException(exn)
1933 }
1934 }
1935
1936 impl ::fbthrift::ExceptionInfo for LookupAndTraverseExn {
1937 fn exn_name(&self) -> &'static str {
1938 match self {
1939 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
1940 Self::ApplicationException(aexn) => aexn.exn_name(),
1941 }
1942 }
1943
1944 fn exn_value(&self) -> String {
1945 match self {
1946 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
1947 Self::ApplicationException(aexn) => aexn.exn_value(),
1948 }
1949 }
1950
1951 fn exn_is_declared(&self) -> bool {
1952 match self {
1953 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
1954 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
1955 }
1956 }
1957 }
1958
1959 impl ::fbthrift::ResultInfo for LookupAndTraverseExn {
1960 fn result_type(&self) -> ::fbthrift::ResultType {
1961 match self {
1962 Self::Success(_) => ::fbthrift::ResultType::Return,
1963 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
1964 }
1965 }
1966 }
1967
1968 impl ::fbthrift::GetTType for LookupAndTraverseExn {
1969 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
1970 }
1971
1972 impl<P> ::fbthrift::Serialize<P> for LookupAndTraverseExn
1973 where
1974 P: ::fbthrift::ProtocolWriter,
1975 {
1976 fn write(&self, p: &mut P) {
1977 if let Self::ApplicationException(aexn) = self {
1978 return aexn.write(p);
1979 }
1980 p.write_struct_begin("LookupAndTraverse");
1981 match self {
1982 Self::Success(inner) => {
1983 p.write_field_begin(
1984 "Success",
1985 ::fbthrift::TType::Struct,
1986 0i16,
1987 );
1988 inner.write(p);
1989 p.write_field_end();
1990 }
1991 Self::ApplicationException(_aexn) => unreachable!(),
1992 }
1993 p.write_field_stop();
1994 p.write_struct_end();
1995 }
1996 }
1997
1998 impl<P> ::fbthrift::Deserialize<P> for LookupAndTraverseExn
1999 where
2000 P: ::fbthrift::ProtocolReader,
2001 {
2002 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2003 static RETURNS: &[::fbthrift::Field] = &[
2004 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2005 ];
2006 let _ = p.read_struct_begin(|_| ())?;
2007 let mut once = false;
2008 let mut alt = ::std::option::Option::None;
2009 loop {
2010 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2011 match ((fty, fid as ::std::primitive::i32), once) {
2012 ((::fbthrift::TType::Stop, _), _) => {
2013 p.read_field_end()?;
2014 break;
2015 }
2016 ((::fbthrift::TType::Struct, 0i32), false) => {
2017 once = true;
2018 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2019 }
2020 ((ty, _id), false) => p.skip(ty)?,
2021 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2022 ::fbthrift::ApplicationException::new(
2023 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2024 format!(
2025 "unwanted extra union {} field ty {:?} id {}",
2026 "LookupAndTraverseExn",
2027 badty,
2028 badid,
2029 ),
2030 )
2031 )),
2032 }
2033 p.read_field_end()?;
2034 }
2035 p.read_struct_end()?;
2036 alt.ok_or_else(||
2037 ::fbthrift::ApplicationException::new(
2038 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2039 format!("Empty union {}", "LookupAndTraverseExn"),
2040 )
2041 .into(),
2042 )
2043 }
2044 }
2045
2046 #[derive(Clone, Debug)]
2047 pub enum ChainUpdateEdgeExn {
2048 #[doc(hidden)]
2049 Success(crate::types::UpdateResponse),
2050 ApplicationException(::fbthrift::ApplicationException),
2051 }
2052
2053 impl ::std::convert::From<crate::errors::graph_storage_service::ChainUpdateEdgeError> for ChainUpdateEdgeExn {
2054 fn from(err: crate::errors::graph_storage_service::ChainUpdateEdgeError) -> Self {
2055 match err {
2056 crate::errors::graph_storage_service::ChainUpdateEdgeError::ApplicationException(aexn) => ChainUpdateEdgeExn::ApplicationException(aexn),
2057 crate::errors::graph_storage_service::ChainUpdateEdgeError::ThriftError(err) => ChainUpdateEdgeExn::ApplicationException(::fbthrift::ApplicationException {
2058 message: err.to_string(),
2059 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2060 }),
2061 }
2062 }
2063 }
2064
2065 impl ::std::convert::From<::fbthrift::ApplicationException> for ChainUpdateEdgeExn {
2066 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2067 Self::ApplicationException(exn)
2068 }
2069 }
2070
2071 impl ::fbthrift::ExceptionInfo for ChainUpdateEdgeExn {
2072 fn exn_name(&self) -> &'static str {
2073 match self {
2074 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2075 Self::ApplicationException(aexn) => aexn.exn_name(),
2076 }
2077 }
2078
2079 fn exn_value(&self) -> String {
2080 match self {
2081 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2082 Self::ApplicationException(aexn) => aexn.exn_value(),
2083 }
2084 }
2085
2086 fn exn_is_declared(&self) -> bool {
2087 match self {
2088 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2089 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2090 }
2091 }
2092 }
2093
2094 impl ::fbthrift::ResultInfo for ChainUpdateEdgeExn {
2095 fn result_type(&self) -> ::fbthrift::ResultType {
2096 match self {
2097 Self::Success(_) => ::fbthrift::ResultType::Return,
2098 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2099 }
2100 }
2101 }
2102
2103 impl ::fbthrift::GetTType for ChainUpdateEdgeExn {
2104 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2105 }
2106
2107 impl<P> ::fbthrift::Serialize<P> for ChainUpdateEdgeExn
2108 where
2109 P: ::fbthrift::ProtocolWriter,
2110 {
2111 fn write(&self, p: &mut P) {
2112 if let Self::ApplicationException(aexn) = self {
2113 return aexn.write(p);
2114 }
2115 p.write_struct_begin("ChainUpdateEdge");
2116 match self {
2117 Self::Success(inner) => {
2118 p.write_field_begin(
2119 "Success",
2120 ::fbthrift::TType::Struct,
2121 0i16,
2122 );
2123 inner.write(p);
2124 p.write_field_end();
2125 }
2126 Self::ApplicationException(_aexn) => unreachable!(),
2127 }
2128 p.write_field_stop();
2129 p.write_struct_end();
2130 }
2131 }
2132
2133 impl<P> ::fbthrift::Deserialize<P> for ChainUpdateEdgeExn
2134 where
2135 P: ::fbthrift::ProtocolReader,
2136 {
2137 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2138 static RETURNS: &[::fbthrift::Field] = &[
2139 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2140 ];
2141 let _ = p.read_struct_begin(|_| ())?;
2142 let mut once = false;
2143 let mut alt = ::std::option::Option::None;
2144 loop {
2145 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2146 match ((fty, fid as ::std::primitive::i32), once) {
2147 ((::fbthrift::TType::Stop, _), _) => {
2148 p.read_field_end()?;
2149 break;
2150 }
2151 ((::fbthrift::TType::Struct, 0i32), false) => {
2152 once = true;
2153 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2154 }
2155 ((ty, _id), false) => p.skip(ty)?,
2156 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2157 ::fbthrift::ApplicationException::new(
2158 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2159 format!(
2160 "unwanted extra union {} field ty {:?} id {}",
2161 "ChainUpdateEdgeExn",
2162 badty,
2163 badid,
2164 ),
2165 )
2166 )),
2167 }
2168 p.read_field_end()?;
2169 }
2170 p.read_struct_end()?;
2171 alt.ok_or_else(||
2172 ::fbthrift::ApplicationException::new(
2173 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2174 format!("Empty union {}", "ChainUpdateEdgeExn"),
2175 )
2176 .into(),
2177 )
2178 }
2179 }
2180
2181 #[derive(Clone, Debug)]
2182 pub enum ChainAddEdgesExn {
2183 #[doc(hidden)]
2184 Success(crate::types::ExecResponse),
2185 ApplicationException(::fbthrift::ApplicationException),
2186 }
2187
2188 impl ::std::convert::From<crate::errors::graph_storage_service::ChainAddEdgesError> for ChainAddEdgesExn {
2189 fn from(err: crate::errors::graph_storage_service::ChainAddEdgesError) -> Self {
2190 match err {
2191 crate::errors::graph_storage_service::ChainAddEdgesError::ApplicationException(aexn) => ChainAddEdgesExn::ApplicationException(aexn),
2192 crate::errors::graph_storage_service::ChainAddEdgesError::ThriftError(err) => ChainAddEdgesExn::ApplicationException(::fbthrift::ApplicationException {
2193 message: err.to_string(),
2194 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2195 }),
2196 }
2197 }
2198 }
2199
2200 impl ::std::convert::From<::fbthrift::ApplicationException> for ChainAddEdgesExn {
2201 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2202 Self::ApplicationException(exn)
2203 }
2204 }
2205
2206 impl ::fbthrift::ExceptionInfo for ChainAddEdgesExn {
2207 fn exn_name(&self) -> &'static str {
2208 match self {
2209 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2210 Self::ApplicationException(aexn) => aexn.exn_name(),
2211 }
2212 }
2213
2214 fn exn_value(&self) -> String {
2215 match self {
2216 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2217 Self::ApplicationException(aexn) => aexn.exn_value(),
2218 }
2219 }
2220
2221 fn exn_is_declared(&self) -> bool {
2222 match self {
2223 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2224 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2225 }
2226 }
2227 }
2228
2229 impl ::fbthrift::ResultInfo for ChainAddEdgesExn {
2230 fn result_type(&self) -> ::fbthrift::ResultType {
2231 match self {
2232 Self::Success(_) => ::fbthrift::ResultType::Return,
2233 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2234 }
2235 }
2236 }
2237
2238 impl ::fbthrift::GetTType for ChainAddEdgesExn {
2239 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2240 }
2241
2242 impl<P> ::fbthrift::Serialize<P> for ChainAddEdgesExn
2243 where
2244 P: ::fbthrift::ProtocolWriter,
2245 {
2246 fn write(&self, p: &mut P) {
2247 if let Self::ApplicationException(aexn) = self {
2248 return aexn.write(p);
2249 }
2250 p.write_struct_begin("ChainAddEdges");
2251 match self {
2252 Self::Success(inner) => {
2253 p.write_field_begin(
2254 "Success",
2255 ::fbthrift::TType::Struct,
2256 0i16,
2257 );
2258 inner.write(p);
2259 p.write_field_end();
2260 }
2261 Self::ApplicationException(_aexn) => unreachable!(),
2262 }
2263 p.write_field_stop();
2264 p.write_struct_end();
2265 }
2266 }
2267
2268 impl<P> ::fbthrift::Deserialize<P> for ChainAddEdgesExn
2269 where
2270 P: ::fbthrift::ProtocolReader,
2271 {
2272 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2273 static RETURNS: &[::fbthrift::Field] = &[
2274 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2275 ];
2276 let _ = p.read_struct_begin(|_| ())?;
2277 let mut once = false;
2278 let mut alt = ::std::option::Option::None;
2279 loop {
2280 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2281 match ((fty, fid as ::std::primitive::i32), once) {
2282 ((::fbthrift::TType::Stop, _), _) => {
2283 p.read_field_end()?;
2284 break;
2285 }
2286 ((::fbthrift::TType::Struct, 0i32), false) => {
2287 once = true;
2288 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2289 }
2290 ((ty, _id), false) => p.skip(ty)?,
2291 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2292 ::fbthrift::ApplicationException::new(
2293 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2294 format!(
2295 "unwanted extra union {} field ty {:?} id {}",
2296 "ChainAddEdgesExn",
2297 badty,
2298 badid,
2299 ),
2300 )
2301 )),
2302 }
2303 p.read_field_end()?;
2304 }
2305 p.read_struct_end()?;
2306 alt.ok_or_else(||
2307 ::fbthrift::ApplicationException::new(
2308 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2309 format!("Empty union {}", "ChainAddEdgesExn"),
2310 )
2311 .into(),
2312 )
2313 }
2314 }
2315
2316 #[derive(Clone, Debug)]
2317 pub enum ChainDeleteEdgesExn {
2318 #[doc(hidden)]
2319 Success(crate::types::ExecResponse),
2320 ApplicationException(::fbthrift::ApplicationException),
2321 }
2322
2323 impl ::std::convert::From<crate::errors::graph_storage_service::ChainDeleteEdgesError> for ChainDeleteEdgesExn {
2324 fn from(err: crate::errors::graph_storage_service::ChainDeleteEdgesError) -> Self {
2325 match err {
2326 crate::errors::graph_storage_service::ChainDeleteEdgesError::ApplicationException(aexn) => ChainDeleteEdgesExn::ApplicationException(aexn),
2327 crate::errors::graph_storage_service::ChainDeleteEdgesError::ThriftError(err) => ChainDeleteEdgesExn::ApplicationException(::fbthrift::ApplicationException {
2328 message: err.to_string(),
2329 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2330 }),
2331 }
2332 }
2333 }
2334
2335 impl ::std::convert::From<::fbthrift::ApplicationException> for ChainDeleteEdgesExn {
2336 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2337 Self::ApplicationException(exn)
2338 }
2339 }
2340
2341 impl ::fbthrift::ExceptionInfo for ChainDeleteEdgesExn {
2342 fn exn_name(&self) -> &'static str {
2343 match self {
2344 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2345 Self::ApplicationException(aexn) => aexn.exn_name(),
2346 }
2347 }
2348
2349 fn exn_value(&self) -> String {
2350 match self {
2351 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2352 Self::ApplicationException(aexn) => aexn.exn_value(),
2353 }
2354 }
2355
2356 fn exn_is_declared(&self) -> bool {
2357 match self {
2358 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2359 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2360 }
2361 }
2362 }
2363
2364 impl ::fbthrift::ResultInfo for ChainDeleteEdgesExn {
2365 fn result_type(&self) -> ::fbthrift::ResultType {
2366 match self {
2367 Self::Success(_) => ::fbthrift::ResultType::Return,
2368 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2369 }
2370 }
2371 }
2372
2373 impl ::fbthrift::GetTType for ChainDeleteEdgesExn {
2374 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2375 }
2376
2377 impl<P> ::fbthrift::Serialize<P> for ChainDeleteEdgesExn
2378 where
2379 P: ::fbthrift::ProtocolWriter,
2380 {
2381 fn write(&self, p: &mut P) {
2382 if let Self::ApplicationException(aexn) = self {
2383 return aexn.write(p);
2384 }
2385 p.write_struct_begin("ChainDeleteEdges");
2386 match self {
2387 Self::Success(inner) => {
2388 p.write_field_begin(
2389 "Success",
2390 ::fbthrift::TType::Struct,
2391 0i16,
2392 );
2393 inner.write(p);
2394 p.write_field_end();
2395 }
2396 Self::ApplicationException(_aexn) => unreachable!(),
2397 }
2398 p.write_field_stop();
2399 p.write_struct_end();
2400 }
2401 }
2402
2403 impl<P> ::fbthrift::Deserialize<P> for ChainDeleteEdgesExn
2404 where
2405 P: ::fbthrift::ProtocolReader,
2406 {
2407 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2408 static RETURNS: &[::fbthrift::Field] = &[
2409 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2410 ];
2411 let _ = p.read_struct_begin(|_| ())?;
2412 let mut once = false;
2413 let mut alt = ::std::option::Option::None;
2414 loop {
2415 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2416 match ((fty, fid as ::std::primitive::i32), once) {
2417 ((::fbthrift::TType::Stop, _), _) => {
2418 p.read_field_end()?;
2419 break;
2420 }
2421 ((::fbthrift::TType::Struct, 0i32), false) => {
2422 once = true;
2423 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2424 }
2425 ((ty, _id), false) => p.skip(ty)?,
2426 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2427 ::fbthrift::ApplicationException::new(
2428 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2429 format!(
2430 "unwanted extra union {} field ty {:?} id {}",
2431 "ChainDeleteEdgesExn",
2432 badty,
2433 badid,
2434 ),
2435 )
2436 )),
2437 }
2438 p.read_field_end()?;
2439 }
2440 p.read_struct_end()?;
2441 alt.ok_or_else(||
2442 ::fbthrift::ApplicationException::new(
2443 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2444 format!("Empty union {}", "ChainDeleteEdgesExn"),
2445 )
2446 .into(),
2447 )
2448 }
2449 }
2450
2451 #[derive(Clone, Debug)]
2452 pub enum GetExn {
2453 #[doc(hidden)]
2454 Success(crate::types::KVGetResponse),
2455 ApplicationException(::fbthrift::ApplicationException),
2456 }
2457
2458 impl ::std::convert::From<crate::errors::graph_storage_service::GetError> for GetExn {
2459 fn from(err: crate::errors::graph_storage_service::GetError) -> Self {
2460 match err {
2461 crate::errors::graph_storage_service::GetError::ApplicationException(aexn) => GetExn::ApplicationException(aexn),
2462 crate::errors::graph_storage_service::GetError::ThriftError(err) => GetExn::ApplicationException(::fbthrift::ApplicationException {
2463 message: err.to_string(),
2464 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2465 }),
2466 }
2467 }
2468 }
2469
2470 impl ::std::convert::From<::fbthrift::ApplicationException> for GetExn {
2471 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2472 Self::ApplicationException(exn)
2473 }
2474 }
2475
2476 impl ::fbthrift::ExceptionInfo for GetExn {
2477 fn exn_name(&self) -> &'static str {
2478 match self {
2479 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2480 Self::ApplicationException(aexn) => aexn.exn_name(),
2481 }
2482 }
2483
2484 fn exn_value(&self) -> String {
2485 match self {
2486 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2487 Self::ApplicationException(aexn) => aexn.exn_value(),
2488 }
2489 }
2490
2491 fn exn_is_declared(&self) -> bool {
2492 match self {
2493 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2494 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2495 }
2496 }
2497 }
2498
2499 impl ::fbthrift::ResultInfo for GetExn {
2500 fn result_type(&self) -> ::fbthrift::ResultType {
2501 match self {
2502 Self::Success(_) => ::fbthrift::ResultType::Return,
2503 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2504 }
2505 }
2506 }
2507
2508 impl ::fbthrift::GetTType for GetExn {
2509 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2510 }
2511
2512 impl<P> ::fbthrift::Serialize<P> for GetExn
2513 where
2514 P: ::fbthrift::ProtocolWriter,
2515 {
2516 fn write(&self, p: &mut P) {
2517 if let Self::ApplicationException(aexn) = self {
2518 return aexn.write(p);
2519 }
2520 p.write_struct_begin("Get");
2521 match self {
2522 Self::Success(inner) => {
2523 p.write_field_begin(
2524 "Success",
2525 ::fbthrift::TType::Struct,
2526 0i16,
2527 );
2528 inner.write(p);
2529 p.write_field_end();
2530 }
2531 Self::ApplicationException(_aexn) => unreachable!(),
2532 }
2533 p.write_field_stop();
2534 p.write_struct_end();
2535 }
2536 }
2537
2538 impl<P> ::fbthrift::Deserialize<P> for GetExn
2539 where
2540 P: ::fbthrift::ProtocolReader,
2541 {
2542 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2543 static RETURNS: &[::fbthrift::Field] = &[
2544 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2545 ];
2546 let _ = p.read_struct_begin(|_| ())?;
2547 let mut once = false;
2548 let mut alt = ::std::option::Option::None;
2549 loop {
2550 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2551 match ((fty, fid as ::std::primitive::i32), once) {
2552 ((::fbthrift::TType::Stop, _), _) => {
2553 p.read_field_end()?;
2554 break;
2555 }
2556 ((::fbthrift::TType::Struct, 0i32), false) => {
2557 once = true;
2558 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2559 }
2560 ((ty, _id), false) => p.skip(ty)?,
2561 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2562 ::fbthrift::ApplicationException::new(
2563 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2564 format!(
2565 "unwanted extra union {} field ty {:?} id {}",
2566 "GetExn",
2567 badty,
2568 badid,
2569 ),
2570 )
2571 )),
2572 }
2573 p.read_field_end()?;
2574 }
2575 p.read_struct_end()?;
2576 alt.ok_or_else(||
2577 ::fbthrift::ApplicationException::new(
2578 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2579 format!("Empty union {}", "GetExn"),
2580 )
2581 .into(),
2582 )
2583 }
2584 }
2585
2586 #[derive(Clone, Debug)]
2587 pub enum PutExn {
2588 #[doc(hidden)]
2589 Success(crate::types::ExecResponse),
2590 ApplicationException(::fbthrift::ApplicationException),
2591 }
2592
2593 impl ::std::convert::From<crate::errors::graph_storage_service::PutError> for PutExn {
2594 fn from(err: crate::errors::graph_storage_service::PutError) -> Self {
2595 match err {
2596 crate::errors::graph_storage_service::PutError::ApplicationException(aexn) => PutExn::ApplicationException(aexn),
2597 crate::errors::graph_storage_service::PutError::ThriftError(err) => PutExn::ApplicationException(::fbthrift::ApplicationException {
2598 message: err.to_string(),
2599 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2600 }),
2601 }
2602 }
2603 }
2604
2605 impl ::std::convert::From<::fbthrift::ApplicationException> for PutExn {
2606 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2607 Self::ApplicationException(exn)
2608 }
2609 }
2610
2611 impl ::fbthrift::ExceptionInfo for PutExn {
2612 fn exn_name(&self) -> &'static str {
2613 match self {
2614 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2615 Self::ApplicationException(aexn) => aexn.exn_name(),
2616 }
2617 }
2618
2619 fn exn_value(&self) -> String {
2620 match self {
2621 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2622 Self::ApplicationException(aexn) => aexn.exn_value(),
2623 }
2624 }
2625
2626 fn exn_is_declared(&self) -> bool {
2627 match self {
2628 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2629 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2630 }
2631 }
2632 }
2633
2634 impl ::fbthrift::ResultInfo for PutExn {
2635 fn result_type(&self) -> ::fbthrift::ResultType {
2636 match self {
2637 Self::Success(_) => ::fbthrift::ResultType::Return,
2638 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2639 }
2640 }
2641 }
2642
2643 impl ::fbthrift::GetTType for PutExn {
2644 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2645 }
2646
2647 impl<P> ::fbthrift::Serialize<P> for PutExn
2648 where
2649 P: ::fbthrift::ProtocolWriter,
2650 {
2651 fn write(&self, p: &mut P) {
2652 if let Self::ApplicationException(aexn) = self {
2653 return aexn.write(p);
2654 }
2655 p.write_struct_begin("Put");
2656 match self {
2657 Self::Success(inner) => {
2658 p.write_field_begin(
2659 "Success",
2660 ::fbthrift::TType::Struct,
2661 0i16,
2662 );
2663 inner.write(p);
2664 p.write_field_end();
2665 }
2666 Self::ApplicationException(_aexn) => unreachable!(),
2667 }
2668 p.write_field_stop();
2669 p.write_struct_end();
2670 }
2671 }
2672
2673 impl<P> ::fbthrift::Deserialize<P> for PutExn
2674 where
2675 P: ::fbthrift::ProtocolReader,
2676 {
2677 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2678 static RETURNS: &[::fbthrift::Field] = &[
2679 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2680 ];
2681 let _ = p.read_struct_begin(|_| ())?;
2682 let mut once = false;
2683 let mut alt = ::std::option::Option::None;
2684 loop {
2685 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2686 match ((fty, fid as ::std::primitive::i32), once) {
2687 ((::fbthrift::TType::Stop, _), _) => {
2688 p.read_field_end()?;
2689 break;
2690 }
2691 ((::fbthrift::TType::Struct, 0i32), false) => {
2692 once = true;
2693 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2694 }
2695 ((ty, _id), false) => p.skip(ty)?,
2696 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2697 ::fbthrift::ApplicationException::new(
2698 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2699 format!(
2700 "unwanted extra union {} field ty {:?} id {}",
2701 "PutExn",
2702 badty,
2703 badid,
2704 ),
2705 )
2706 )),
2707 }
2708 p.read_field_end()?;
2709 }
2710 p.read_struct_end()?;
2711 alt.ok_or_else(||
2712 ::fbthrift::ApplicationException::new(
2713 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2714 format!("Empty union {}", "PutExn"),
2715 )
2716 .into(),
2717 )
2718 }
2719 }
2720
2721 #[derive(Clone, Debug)]
2722 pub enum RemoveExn {
2723 #[doc(hidden)]
2724 Success(crate::types::ExecResponse),
2725 ApplicationException(::fbthrift::ApplicationException),
2726 }
2727
2728 impl ::std::convert::From<crate::errors::graph_storage_service::RemoveError> for RemoveExn {
2729 fn from(err: crate::errors::graph_storage_service::RemoveError) -> Self {
2730 match err {
2731 crate::errors::graph_storage_service::RemoveError::ApplicationException(aexn) => RemoveExn::ApplicationException(aexn),
2732 crate::errors::graph_storage_service::RemoveError::ThriftError(err) => RemoveExn::ApplicationException(::fbthrift::ApplicationException {
2733 message: err.to_string(),
2734 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2735 }),
2736 }
2737 }
2738 }
2739
2740 impl ::std::convert::From<::fbthrift::ApplicationException> for RemoveExn {
2741 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2742 Self::ApplicationException(exn)
2743 }
2744 }
2745
2746 impl ::fbthrift::ExceptionInfo for RemoveExn {
2747 fn exn_name(&self) -> &'static str {
2748 match self {
2749 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2750 Self::ApplicationException(aexn) => aexn.exn_name(),
2751 }
2752 }
2753
2754 fn exn_value(&self) -> String {
2755 match self {
2756 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2757 Self::ApplicationException(aexn) => aexn.exn_value(),
2758 }
2759 }
2760
2761 fn exn_is_declared(&self) -> bool {
2762 match self {
2763 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2764 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2765 }
2766 }
2767 }
2768
2769 impl ::fbthrift::ResultInfo for RemoveExn {
2770 fn result_type(&self) -> ::fbthrift::ResultType {
2771 match self {
2772 Self::Success(_) => ::fbthrift::ResultType::Return,
2773 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2774 }
2775 }
2776 }
2777
2778 impl ::fbthrift::GetTType for RemoveExn {
2779 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2780 }
2781
2782 impl<P> ::fbthrift::Serialize<P> for RemoveExn
2783 where
2784 P: ::fbthrift::ProtocolWriter,
2785 {
2786 fn write(&self, p: &mut P) {
2787 if let Self::ApplicationException(aexn) = self {
2788 return aexn.write(p);
2789 }
2790 p.write_struct_begin("Remove");
2791 match self {
2792 Self::Success(inner) => {
2793 p.write_field_begin(
2794 "Success",
2795 ::fbthrift::TType::Struct,
2796 0i16,
2797 );
2798 inner.write(p);
2799 p.write_field_end();
2800 }
2801 Self::ApplicationException(_aexn) => unreachable!(),
2802 }
2803 p.write_field_stop();
2804 p.write_struct_end();
2805 }
2806 }
2807
2808 impl<P> ::fbthrift::Deserialize<P> for RemoveExn
2809 where
2810 P: ::fbthrift::ProtocolReader,
2811 {
2812 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2813 static RETURNS: &[::fbthrift::Field] = &[
2814 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2815 ];
2816 let _ = p.read_struct_begin(|_| ())?;
2817 let mut once = false;
2818 let mut alt = ::std::option::Option::None;
2819 loop {
2820 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2821 match ((fty, fid as ::std::primitive::i32), once) {
2822 ((::fbthrift::TType::Stop, _), _) => {
2823 p.read_field_end()?;
2824 break;
2825 }
2826 ((::fbthrift::TType::Struct, 0i32), false) => {
2827 once = true;
2828 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2829 }
2830 ((ty, _id), false) => p.skip(ty)?,
2831 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2832 ::fbthrift::ApplicationException::new(
2833 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2834 format!(
2835 "unwanted extra union {} field ty {:?} id {}",
2836 "RemoveExn",
2837 badty,
2838 badid,
2839 ),
2840 )
2841 )),
2842 }
2843 p.read_field_end()?;
2844 }
2845 p.read_struct_end()?;
2846 alt.ok_or_else(||
2847 ::fbthrift::ApplicationException::new(
2848 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2849 format!("Empty union {}", "RemoveExn"),
2850 )
2851 .into(),
2852 )
2853 }
2854 }
2855 }
2856
2857 pub mod storage_admin_service {
2858 #[derive(Clone, Debug)]
2859 pub enum TransLeaderExn {
2860 #[doc(hidden)]
2861 Success(crate::types::AdminExecResp),
2862 ApplicationException(::fbthrift::ApplicationException),
2863 }
2864
2865 impl ::std::convert::From<crate::errors::storage_admin_service::TransLeaderError> for TransLeaderExn {
2866 fn from(err: crate::errors::storage_admin_service::TransLeaderError) -> Self {
2867 match err {
2868 crate::errors::storage_admin_service::TransLeaderError::ApplicationException(aexn) => TransLeaderExn::ApplicationException(aexn),
2869 crate::errors::storage_admin_service::TransLeaderError::ThriftError(err) => TransLeaderExn::ApplicationException(::fbthrift::ApplicationException {
2870 message: err.to_string(),
2871 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
2872 }),
2873 }
2874 }
2875 }
2876
2877 impl ::std::convert::From<::fbthrift::ApplicationException> for TransLeaderExn {
2878 fn from(exn: ::fbthrift::ApplicationException) -> Self {
2879 Self::ApplicationException(exn)
2880 }
2881 }
2882
2883 impl ::fbthrift::ExceptionInfo for TransLeaderExn {
2884 fn exn_name(&self) -> &'static str {
2885 match self {
2886 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
2887 Self::ApplicationException(aexn) => aexn.exn_name(),
2888 }
2889 }
2890
2891 fn exn_value(&self) -> String {
2892 match self {
2893 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
2894 Self::ApplicationException(aexn) => aexn.exn_value(),
2895 }
2896 }
2897
2898 fn exn_is_declared(&self) -> bool {
2899 match self {
2900 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
2901 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
2902 }
2903 }
2904 }
2905
2906 impl ::fbthrift::ResultInfo for TransLeaderExn {
2907 fn result_type(&self) -> ::fbthrift::ResultType {
2908 match self {
2909 Self::Success(_) => ::fbthrift::ResultType::Return,
2910 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
2911 }
2912 }
2913 }
2914
2915 impl ::fbthrift::GetTType for TransLeaderExn {
2916 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
2917 }
2918
2919 impl<P> ::fbthrift::Serialize<P> for TransLeaderExn
2920 where
2921 P: ::fbthrift::ProtocolWriter,
2922 {
2923 fn write(&self, p: &mut P) {
2924 if let Self::ApplicationException(aexn) = self {
2925 return aexn.write(p);
2926 }
2927 p.write_struct_begin("TransLeader");
2928 match self {
2929 Self::Success(inner) => {
2930 p.write_field_begin(
2931 "Success",
2932 ::fbthrift::TType::Struct,
2933 0i16,
2934 );
2935 inner.write(p);
2936 p.write_field_end();
2937 }
2938 Self::ApplicationException(_aexn) => unreachable!(),
2939 }
2940 p.write_field_stop();
2941 p.write_struct_end();
2942 }
2943 }
2944
2945 impl<P> ::fbthrift::Deserialize<P> for TransLeaderExn
2946 where
2947 P: ::fbthrift::ProtocolReader,
2948 {
2949 fn read(p: &mut P) -> ::anyhow::Result<Self> {
2950 static RETURNS: &[::fbthrift::Field] = &[
2951 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
2952 ];
2953 let _ = p.read_struct_begin(|_| ())?;
2954 let mut once = false;
2955 let mut alt = ::std::option::Option::None;
2956 loop {
2957 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
2958 match ((fty, fid as ::std::primitive::i32), once) {
2959 ((::fbthrift::TType::Stop, _), _) => {
2960 p.read_field_end()?;
2961 break;
2962 }
2963 ((::fbthrift::TType::Struct, 0i32), false) => {
2964 once = true;
2965 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
2966 }
2967 ((ty, _id), false) => p.skip(ty)?,
2968 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
2969 ::fbthrift::ApplicationException::new(
2970 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
2971 format!(
2972 "unwanted extra union {} field ty {:?} id {}",
2973 "TransLeaderExn",
2974 badty,
2975 badid,
2976 ),
2977 )
2978 )),
2979 }
2980 p.read_field_end()?;
2981 }
2982 p.read_struct_end()?;
2983 alt.ok_or_else(||
2984 ::fbthrift::ApplicationException::new(
2985 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
2986 format!("Empty union {}", "TransLeaderExn"),
2987 )
2988 .into(),
2989 )
2990 }
2991 }
2992
2993 #[derive(Clone, Debug)]
2994 pub enum AddPartExn {
2995 #[doc(hidden)]
2996 Success(crate::types::AdminExecResp),
2997 ApplicationException(::fbthrift::ApplicationException),
2998 }
2999
3000 impl ::std::convert::From<crate::errors::storage_admin_service::AddPartError> for AddPartExn {
3001 fn from(err: crate::errors::storage_admin_service::AddPartError) -> Self {
3002 match err {
3003 crate::errors::storage_admin_service::AddPartError::ApplicationException(aexn) => AddPartExn::ApplicationException(aexn),
3004 crate::errors::storage_admin_service::AddPartError::ThriftError(err) => AddPartExn::ApplicationException(::fbthrift::ApplicationException {
3005 message: err.to_string(),
3006 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3007 }),
3008 }
3009 }
3010 }
3011
3012 impl ::std::convert::From<::fbthrift::ApplicationException> for AddPartExn {
3013 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3014 Self::ApplicationException(exn)
3015 }
3016 }
3017
3018 impl ::fbthrift::ExceptionInfo for AddPartExn {
3019 fn exn_name(&self) -> &'static str {
3020 match self {
3021 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3022 Self::ApplicationException(aexn) => aexn.exn_name(),
3023 }
3024 }
3025
3026 fn exn_value(&self) -> String {
3027 match self {
3028 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3029 Self::ApplicationException(aexn) => aexn.exn_value(),
3030 }
3031 }
3032
3033 fn exn_is_declared(&self) -> bool {
3034 match self {
3035 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3036 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3037 }
3038 }
3039 }
3040
3041 impl ::fbthrift::ResultInfo for AddPartExn {
3042 fn result_type(&self) -> ::fbthrift::ResultType {
3043 match self {
3044 Self::Success(_) => ::fbthrift::ResultType::Return,
3045 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3046 }
3047 }
3048 }
3049
3050 impl ::fbthrift::GetTType for AddPartExn {
3051 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3052 }
3053
3054 impl<P> ::fbthrift::Serialize<P> for AddPartExn
3055 where
3056 P: ::fbthrift::ProtocolWriter,
3057 {
3058 fn write(&self, p: &mut P) {
3059 if let Self::ApplicationException(aexn) = self {
3060 return aexn.write(p);
3061 }
3062 p.write_struct_begin("AddPart");
3063 match self {
3064 Self::Success(inner) => {
3065 p.write_field_begin(
3066 "Success",
3067 ::fbthrift::TType::Struct,
3068 0i16,
3069 );
3070 inner.write(p);
3071 p.write_field_end();
3072 }
3073 Self::ApplicationException(_aexn) => unreachable!(),
3074 }
3075 p.write_field_stop();
3076 p.write_struct_end();
3077 }
3078 }
3079
3080 impl<P> ::fbthrift::Deserialize<P> for AddPartExn
3081 where
3082 P: ::fbthrift::ProtocolReader,
3083 {
3084 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3085 static RETURNS: &[::fbthrift::Field] = &[
3086 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3087 ];
3088 let _ = p.read_struct_begin(|_| ())?;
3089 let mut once = false;
3090 let mut alt = ::std::option::Option::None;
3091 loop {
3092 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3093 match ((fty, fid as ::std::primitive::i32), once) {
3094 ((::fbthrift::TType::Stop, _), _) => {
3095 p.read_field_end()?;
3096 break;
3097 }
3098 ((::fbthrift::TType::Struct, 0i32), false) => {
3099 once = true;
3100 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3101 }
3102 ((ty, _id), false) => p.skip(ty)?,
3103 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3104 ::fbthrift::ApplicationException::new(
3105 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3106 format!(
3107 "unwanted extra union {} field ty {:?} id {}",
3108 "AddPartExn",
3109 badty,
3110 badid,
3111 ),
3112 )
3113 )),
3114 }
3115 p.read_field_end()?;
3116 }
3117 p.read_struct_end()?;
3118 alt.ok_or_else(||
3119 ::fbthrift::ApplicationException::new(
3120 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3121 format!("Empty union {}", "AddPartExn"),
3122 )
3123 .into(),
3124 )
3125 }
3126 }
3127
3128 #[derive(Clone, Debug)]
3129 pub enum AddLearnerExn {
3130 #[doc(hidden)]
3131 Success(crate::types::AdminExecResp),
3132 ApplicationException(::fbthrift::ApplicationException),
3133 }
3134
3135 impl ::std::convert::From<crate::errors::storage_admin_service::AddLearnerError> for AddLearnerExn {
3136 fn from(err: crate::errors::storage_admin_service::AddLearnerError) -> Self {
3137 match err {
3138 crate::errors::storage_admin_service::AddLearnerError::ApplicationException(aexn) => AddLearnerExn::ApplicationException(aexn),
3139 crate::errors::storage_admin_service::AddLearnerError::ThriftError(err) => AddLearnerExn::ApplicationException(::fbthrift::ApplicationException {
3140 message: err.to_string(),
3141 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3142 }),
3143 }
3144 }
3145 }
3146
3147 impl ::std::convert::From<::fbthrift::ApplicationException> for AddLearnerExn {
3148 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3149 Self::ApplicationException(exn)
3150 }
3151 }
3152
3153 impl ::fbthrift::ExceptionInfo for AddLearnerExn {
3154 fn exn_name(&self) -> &'static str {
3155 match self {
3156 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3157 Self::ApplicationException(aexn) => aexn.exn_name(),
3158 }
3159 }
3160
3161 fn exn_value(&self) -> String {
3162 match self {
3163 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3164 Self::ApplicationException(aexn) => aexn.exn_value(),
3165 }
3166 }
3167
3168 fn exn_is_declared(&self) -> bool {
3169 match self {
3170 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3171 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3172 }
3173 }
3174 }
3175
3176 impl ::fbthrift::ResultInfo for AddLearnerExn {
3177 fn result_type(&self) -> ::fbthrift::ResultType {
3178 match self {
3179 Self::Success(_) => ::fbthrift::ResultType::Return,
3180 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3181 }
3182 }
3183 }
3184
3185 impl ::fbthrift::GetTType for AddLearnerExn {
3186 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3187 }
3188
3189 impl<P> ::fbthrift::Serialize<P> for AddLearnerExn
3190 where
3191 P: ::fbthrift::ProtocolWriter,
3192 {
3193 fn write(&self, p: &mut P) {
3194 if let Self::ApplicationException(aexn) = self {
3195 return aexn.write(p);
3196 }
3197 p.write_struct_begin("AddLearner");
3198 match self {
3199 Self::Success(inner) => {
3200 p.write_field_begin(
3201 "Success",
3202 ::fbthrift::TType::Struct,
3203 0i16,
3204 );
3205 inner.write(p);
3206 p.write_field_end();
3207 }
3208 Self::ApplicationException(_aexn) => unreachable!(),
3209 }
3210 p.write_field_stop();
3211 p.write_struct_end();
3212 }
3213 }
3214
3215 impl<P> ::fbthrift::Deserialize<P> for AddLearnerExn
3216 where
3217 P: ::fbthrift::ProtocolReader,
3218 {
3219 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3220 static RETURNS: &[::fbthrift::Field] = &[
3221 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3222 ];
3223 let _ = p.read_struct_begin(|_| ())?;
3224 let mut once = false;
3225 let mut alt = ::std::option::Option::None;
3226 loop {
3227 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3228 match ((fty, fid as ::std::primitive::i32), once) {
3229 ((::fbthrift::TType::Stop, _), _) => {
3230 p.read_field_end()?;
3231 break;
3232 }
3233 ((::fbthrift::TType::Struct, 0i32), false) => {
3234 once = true;
3235 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3236 }
3237 ((ty, _id), false) => p.skip(ty)?,
3238 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3239 ::fbthrift::ApplicationException::new(
3240 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3241 format!(
3242 "unwanted extra union {} field ty {:?} id {}",
3243 "AddLearnerExn",
3244 badty,
3245 badid,
3246 ),
3247 )
3248 )),
3249 }
3250 p.read_field_end()?;
3251 }
3252 p.read_struct_end()?;
3253 alt.ok_or_else(||
3254 ::fbthrift::ApplicationException::new(
3255 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3256 format!("Empty union {}", "AddLearnerExn"),
3257 )
3258 .into(),
3259 )
3260 }
3261 }
3262
3263 #[derive(Clone, Debug)]
3264 pub enum RemovePartExn {
3265 #[doc(hidden)]
3266 Success(crate::types::AdminExecResp),
3267 ApplicationException(::fbthrift::ApplicationException),
3268 }
3269
3270 impl ::std::convert::From<crate::errors::storage_admin_service::RemovePartError> for RemovePartExn {
3271 fn from(err: crate::errors::storage_admin_service::RemovePartError) -> Self {
3272 match err {
3273 crate::errors::storage_admin_service::RemovePartError::ApplicationException(aexn) => RemovePartExn::ApplicationException(aexn),
3274 crate::errors::storage_admin_service::RemovePartError::ThriftError(err) => RemovePartExn::ApplicationException(::fbthrift::ApplicationException {
3275 message: err.to_string(),
3276 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3277 }),
3278 }
3279 }
3280 }
3281
3282 impl ::std::convert::From<::fbthrift::ApplicationException> for RemovePartExn {
3283 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3284 Self::ApplicationException(exn)
3285 }
3286 }
3287
3288 impl ::fbthrift::ExceptionInfo for RemovePartExn {
3289 fn exn_name(&self) -> &'static str {
3290 match self {
3291 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3292 Self::ApplicationException(aexn) => aexn.exn_name(),
3293 }
3294 }
3295
3296 fn exn_value(&self) -> String {
3297 match self {
3298 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3299 Self::ApplicationException(aexn) => aexn.exn_value(),
3300 }
3301 }
3302
3303 fn exn_is_declared(&self) -> bool {
3304 match self {
3305 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3306 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3307 }
3308 }
3309 }
3310
3311 impl ::fbthrift::ResultInfo for RemovePartExn {
3312 fn result_type(&self) -> ::fbthrift::ResultType {
3313 match self {
3314 Self::Success(_) => ::fbthrift::ResultType::Return,
3315 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3316 }
3317 }
3318 }
3319
3320 impl ::fbthrift::GetTType for RemovePartExn {
3321 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3322 }
3323
3324 impl<P> ::fbthrift::Serialize<P> for RemovePartExn
3325 where
3326 P: ::fbthrift::ProtocolWriter,
3327 {
3328 fn write(&self, p: &mut P) {
3329 if let Self::ApplicationException(aexn) = self {
3330 return aexn.write(p);
3331 }
3332 p.write_struct_begin("RemovePart");
3333 match self {
3334 Self::Success(inner) => {
3335 p.write_field_begin(
3336 "Success",
3337 ::fbthrift::TType::Struct,
3338 0i16,
3339 );
3340 inner.write(p);
3341 p.write_field_end();
3342 }
3343 Self::ApplicationException(_aexn) => unreachable!(),
3344 }
3345 p.write_field_stop();
3346 p.write_struct_end();
3347 }
3348 }
3349
3350 impl<P> ::fbthrift::Deserialize<P> for RemovePartExn
3351 where
3352 P: ::fbthrift::ProtocolReader,
3353 {
3354 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3355 static RETURNS: &[::fbthrift::Field] = &[
3356 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3357 ];
3358 let _ = p.read_struct_begin(|_| ())?;
3359 let mut once = false;
3360 let mut alt = ::std::option::Option::None;
3361 loop {
3362 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3363 match ((fty, fid as ::std::primitive::i32), once) {
3364 ((::fbthrift::TType::Stop, _), _) => {
3365 p.read_field_end()?;
3366 break;
3367 }
3368 ((::fbthrift::TType::Struct, 0i32), false) => {
3369 once = true;
3370 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3371 }
3372 ((ty, _id), false) => p.skip(ty)?,
3373 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3374 ::fbthrift::ApplicationException::new(
3375 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3376 format!(
3377 "unwanted extra union {} field ty {:?} id {}",
3378 "RemovePartExn",
3379 badty,
3380 badid,
3381 ),
3382 )
3383 )),
3384 }
3385 p.read_field_end()?;
3386 }
3387 p.read_struct_end()?;
3388 alt.ok_or_else(||
3389 ::fbthrift::ApplicationException::new(
3390 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3391 format!("Empty union {}", "RemovePartExn"),
3392 )
3393 .into(),
3394 )
3395 }
3396 }
3397
3398 #[derive(Clone, Debug)]
3399 pub enum MemberChangeExn {
3400 #[doc(hidden)]
3401 Success(crate::types::AdminExecResp),
3402 ApplicationException(::fbthrift::ApplicationException),
3403 }
3404
3405 impl ::std::convert::From<crate::errors::storage_admin_service::MemberChangeError> for MemberChangeExn {
3406 fn from(err: crate::errors::storage_admin_service::MemberChangeError) -> Self {
3407 match err {
3408 crate::errors::storage_admin_service::MemberChangeError::ApplicationException(aexn) => MemberChangeExn::ApplicationException(aexn),
3409 crate::errors::storage_admin_service::MemberChangeError::ThriftError(err) => MemberChangeExn::ApplicationException(::fbthrift::ApplicationException {
3410 message: err.to_string(),
3411 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3412 }),
3413 }
3414 }
3415 }
3416
3417 impl ::std::convert::From<::fbthrift::ApplicationException> for MemberChangeExn {
3418 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3419 Self::ApplicationException(exn)
3420 }
3421 }
3422
3423 impl ::fbthrift::ExceptionInfo for MemberChangeExn {
3424 fn exn_name(&self) -> &'static str {
3425 match self {
3426 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3427 Self::ApplicationException(aexn) => aexn.exn_name(),
3428 }
3429 }
3430
3431 fn exn_value(&self) -> String {
3432 match self {
3433 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3434 Self::ApplicationException(aexn) => aexn.exn_value(),
3435 }
3436 }
3437
3438 fn exn_is_declared(&self) -> bool {
3439 match self {
3440 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3441 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3442 }
3443 }
3444 }
3445
3446 impl ::fbthrift::ResultInfo for MemberChangeExn {
3447 fn result_type(&self) -> ::fbthrift::ResultType {
3448 match self {
3449 Self::Success(_) => ::fbthrift::ResultType::Return,
3450 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3451 }
3452 }
3453 }
3454
3455 impl ::fbthrift::GetTType for MemberChangeExn {
3456 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3457 }
3458
3459 impl<P> ::fbthrift::Serialize<P> for MemberChangeExn
3460 where
3461 P: ::fbthrift::ProtocolWriter,
3462 {
3463 fn write(&self, p: &mut P) {
3464 if let Self::ApplicationException(aexn) = self {
3465 return aexn.write(p);
3466 }
3467 p.write_struct_begin("MemberChange");
3468 match self {
3469 Self::Success(inner) => {
3470 p.write_field_begin(
3471 "Success",
3472 ::fbthrift::TType::Struct,
3473 0i16,
3474 );
3475 inner.write(p);
3476 p.write_field_end();
3477 }
3478 Self::ApplicationException(_aexn) => unreachable!(),
3479 }
3480 p.write_field_stop();
3481 p.write_struct_end();
3482 }
3483 }
3484
3485 impl<P> ::fbthrift::Deserialize<P> for MemberChangeExn
3486 where
3487 P: ::fbthrift::ProtocolReader,
3488 {
3489 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3490 static RETURNS: &[::fbthrift::Field] = &[
3491 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3492 ];
3493 let _ = p.read_struct_begin(|_| ())?;
3494 let mut once = false;
3495 let mut alt = ::std::option::Option::None;
3496 loop {
3497 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3498 match ((fty, fid as ::std::primitive::i32), once) {
3499 ((::fbthrift::TType::Stop, _), _) => {
3500 p.read_field_end()?;
3501 break;
3502 }
3503 ((::fbthrift::TType::Struct, 0i32), false) => {
3504 once = true;
3505 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3506 }
3507 ((ty, _id), false) => p.skip(ty)?,
3508 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3509 ::fbthrift::ApplicationException::new(
3510 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3511 format!(
3512 "unwanted extra union {} field ty {:?} id {}",
3513 "MemberChangeExn",
3514 badty,
3515 badid,
3516 ),
3517 )
3518 )),
3519 }
3520 p.read_field_end()?;
3521 }
3522 p.read_struct_end()?;
3523 alt.ok_or_else(||
3524 ::fbthrift::ApplicationException::new(
3525 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3526 format!("Empty union {}", "MemberChangeExn"),
3527 )
3528 .into(),
3529 )
3530 }
3531 }
3532
3533 #[derive(Clone, Debug)]
3534 pub enum WaitingForCatchUpDataExn {
3535 #[doc(hidden)]
3536 Success(crate::types::AdminExecResp),
3537 ApplicationException(::fbthrift::ApplicationException),
3538 }
3539
3540 impl ::std::convert::From<crate::errors::storage_admin_service::WaitingForCatchUpDataError> for WaitingForCatchUpDataExn {
3541 fn from(err: crate::errors::storage_admin_service::WaitingForCatchUpDataError) -> Self {
3542 match err {
3543 crate::errors::storage_admin_service::WaitingForCatchUpDataError::ApplicationException(aexn) => WaitingForCatchUpDataExn::ApplicationException(aexn),
3544 crate::errors::storage_admin_service::WaitingForCatchUpDataError::ThriftError(err) => WaitingForCatchUpDataExn::ApplicationException(::fbthrift::ApplicationException {
3545 message: err.to_string(),
3546 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3547 }),
3548 }
3549 }
3550 }
3551
3552 impl ::std::convert::From<::fbthrift::ApplicationException> for WaitingForCatchUpDataExn {
3553 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3554 Self::ApplicationException(exn)
3555 }
3556 }
3557
3558 impl ::fbthrift::ExceptionInfo for WaitingForCatchUpDataExn {
3559 fn exn_name(&self) -> &'static str {
3560 match self {
3561 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3562 Self::ApplicationException(aexn) => aexn.exn_name(),
3563 }
3564 }
3565
3566 fn exn_value(&self) -> String {
3567 match self {
3568 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3569 Self::ApplicationException(aexn) => aexn.exn_value(),
3570 }
3571 }
3572
3573 fn exn_is_declared(&self) -> bool {
3574 match self {
3575 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3576 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3577 }
3578 }
3579 }
3580
3581 impl ::fbthrift::ResultInfo for WaitingForCatchUpDataExn {
3582 fn result_type(&self) -> ::fbthrift::ResultType {
3583 match self {
3584 Self::Success(_) => ::fbthrift::ResultType::Return,
3585 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3586 }
3587 }
3588 }
3589
3590 impl ::fbthrift::GetTType for WaitingForCatchUpDataExn {
3591 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3592 }
3593
3594 impl<P> ::fbthrift::Serialize<P> for WaitingForCatchUpDataExn
3595 where
3596 P: ::fbthrift::ProtocolWriter,
3597 {
3598 fn write(&self, p: &mut P) {
3599 if let Self::ApplicationException(aexn) = self {
3600 return aexn.write(p);
3601 }
3602 p.write_struct_begin("WaitingForCatchUpData");
3603 match self {
3604 Self::Success(inner) => {
3605 p.write_field_begin(
3606 "Success",
3607 ::fbthrift::TType::Struct,
3608 0i16,
3609 );
3610 inner.write(p);
3611 p.write_field_end();
3612 }
3613 Self::ApplicationException(_aexn) => unreachable!(),
3614 }
3615 p.write_field_stop();
3616 p.write_struct_end();
3617 }
3618 }
3619
3620 impl<P> ::fbthrift::Deserialize<P> for WaitingForCatchUpDataExn
3621 where
3622 P: ::fbthrift::ProtocolReader,
3623 {
3624 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3625 static RETURNS: &[::fbthrift::Field] = &[
3626 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3627 ];
3628 let _ = p.read_struct_begin(|_| ())?;
3629 let mut once = false;
3630 let mut alt = ::std::option::Option::None;
3631 loop {
3632 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3633 match ((fty, fid as ::std::primitive::i32), once) {
3634 ((::fbthrift::TType::Stop, _), _) => {
3635 p.read_field_end()?;
3636 break;
3637 }
3638 ((::fbthrift::TType::Struct, 0i32), false) => {
3639 once = true;
3640 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3641 }
3642 ((ty, _id), false) => p.skip(ty)?,
3643 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3644 ::fbthrift::ApplicationException::new(
3645 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3646 format!(
3647 "unwanted extra union {} field ty {:?} id {}",
3648 "WaitingForCatchUpDataExn",
3649 badty,
3650 badid,
3651 ),
3652 )
3653 )),
3654 }
3655 p.read_field_end()?;
3656 }
3657 p.read_struct_end()?;
3658 alt.ok_or_else(||
3659 ::fbthrift::ApplicationException::new(
3660 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3661 format!("Empty union {}", "WaitingForCatchUpDataExn"),
3662 )
3663 .into(),
3664 )
3665 }
3666 }
3667
3668 #[derive(Clone, Debug)]
3669 pub enum CreateCheckpointExn {
3670 #[doc(hidden)]
3671 Success(crate::types::CreateCPResp),
3672 ApplicationException(::fbthrift::ApplicationException),
3673 }
3674
3675 impl ::std::convert::From<crate::errors::storage_admin_service::CreateCheckpointError> for CreateCheckpointExn {
3676 fn from(err: crate::errors::storage_admin_service::CreateCheckpointError) -> Self {
3677 match err {
3678 crate::errors::storage_admin_service::CreateCheckpointError::ApplicationException(aexn) => CreateCheckpointExn::ApplicationException(aexn),
3679 crate::errors::storage_admin_service::CreateCheckpointError::ThriftError(err) => CreateCheckpointExn::ApplicationException(::fbthrift::ApplicationException {
3680 message: err.to_string(),
3681 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3682 }),
3683 }
3684 }
3685 }
3686
3687 impl ::std::convert::From<::fbthrift::ApplicationException> for CreateCheckpointExn {
3688 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3689 Self::ApplicationException(exn)
3690 }
3691 }
3692
3693 impl ::fbthrift::ExceptionInfo for CreateCheckpointExn {
3694 fn exn_name(&self) -> &'static str {
3695 match self {
3696 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3697 Self::ApplicationException(aexn) => aexn.exn_name(),
3698 }
3699 }
3700
3701 fn exn_value(&self) -> String {
3702 match self {
3703 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3704 Self::ApplicationException(aexn) => aexn.exn_value(),
3705 }
3706 }
3707
3708 fn exn_is_declared(&self) -> bool {
3709 match self {
3710 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3711 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3712 }
3713 }
3714 }
3715
3716 impl ::fbthrift::ResultInfo for CreateCheckpointExn {
3717 fn result_type(&self) -> ::fbthrift::ResultType {
3718 match self {
3719 Self::Success(_) => ::fbthrift::ResultType::Return,
3720 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3721 }
3722 }
3723 }
3724
3725 impl ::fbthrift::GetTType for CreateCheckpointExn {
3726 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3727 }
3728
3729 impl<P> ::fbthrift::Serialize<P> for CreateCheckpointExn
3730 where
3731 P: ::fbthrift::ProtocolWriter,
3732 {
3733 fn write(&self, p: &mut P) {
3734 if let Self::ApplicationException(aexn) = self {
3735 return aexn.write(p);
3736 }
3737 p.write_struct_begin("CreateCheckpoint");
3738 match self {
3739 Self::Success(inner) => {
3740 p.write_field_begin(
3741 "Success",
3742 ::fbthrift::TType::Struct,
3743 0i16,
3744 );
3745 inner.write(p);
3746 p.write_field_end();
3747 }
3748 Self::ApplicationException(_aexn) => unreachable!(),
3749 }
3750 p.write_field_stop();
3751 p.write_struct_end();
3752 }
3753 }
3754
3755 impl<P> ::fbthrift::Deserialize<P> for CreateCheckpointExn
3756 where
3757 P: ::fbthrift::ProtocolReader,
3758 {
3759 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3760 static RETURNS: &[::fbthrift::Field] = &[
3761 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3762 ];
3763 let _ = p.read_struct_begin(|_| ())?;
3764 let mut once = false;
3765 let mut alt = ::std::option::Option::None;
3766 loop {
3767 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3768 match ((fty, fid as ::std::primitive::i32), once) {
3769 ((::fbthrift::TType::Stop, _), _) => {
3770 p.read_field_end()?;
3771 break;
3772 }
3773 ((::fbthrift::TType::Struct, 0i32), false) => {
3774 once = true;
3775 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3776 }
3777 ((ty, _id), false) => p.skip(ty)?,
3778 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3779 ::fbthrift::ApplicationException::new(
3780 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3781 format!(
3782 "unwanted extra union {} field ty {:?} id {}",
3783 "CreateCheckpointExn",
3784 badty,
3785 badid,
3786 ),
3787 )
3788 )),
3789 }
3790 p.read_field_end()?;
3791 }
3792 p.read_struct_end()?;
3793 alt.ok_or_else(||
3794 ::fbthrift::ApplicationException::new(
3795 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3796 format!("Empty union {}", "CreateCheckpointExn"),
3797 )
3798 .into(),
3799 )
3800 }
3801 }
3802
3803 #[derive(Clone, Debug)]
3804 pub enum DropCheckpointExn {
3805 #[doc(hidden)]
3806 Success(crate::types::DropCPResp),
3807 ApplicationException(::fbthrift::ApplicationException),
3808 }
3809
3810 impl ::std::convert::From<crate::errors::storage_admin_service::DropCheckpointError> for DropCheckpointExn {
3811 fn from(err: crate::errors::storage_admin_service::DropCheckpointError) -> Self {
3812 match err {
3813 crate::errors::storage_admin_service::DropCheckpointError::ApplicationException(aexn) => DropCheckpointExn::ApplicationException(aexn),
3814 crate::errors::storage_admin_service::DropCheckpointError::ThriftError(err) => DropCheckpointExn::ApplicationException(::fbthrift::ApplicationException {
3815 message: err.to_string(),
3816 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3817 }),
3818 }
3819 }
3820 }
3821
3822 impl ::std::convert::From<::fbthrift::ApplicationException> for DropCheckpointExn {
3823 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3824 Self::ApplicationException(exn)
3825 }
3826 }
3827
3828 impl ::fbthrift::ExceptionInfo for DropCheckpointExn {
3829 fn exn_name(&self) -> &'static str {
3830 match self {
3831 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3832 Self::ApplicationException(aexn) => aexn.exn_name(),
3833 }
3834 }
3835
3836 fn exn_value(&self) -> String {
3837 match self {
3838 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3839 Self::ApplicationException(aexn) => aexn.exn_value(),
3840 }
3841 }
3842
3843 fn exn_is_declared(&self) -> bool {
3844 match self {
3845 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3846 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3847 }
3848 }
3849 }
3850
3851 impl ::fbthrift::ResultInfo for DropCheckpointExn {
3852 fn result_type(&self) -> ::fbthrift::ResultType {
3853 match self {
3854 Self::Success(_) => ::fbthrift::ResultType::Return,
3855 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3856 }
3857 }
3858 }
3859
3860 impl ::fbthrift::GetTType for DropCheckpointExn {
3861 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3862 }
3863
3864 impl<P> ::fbthrift::Serialize<P> for DropCheckpointExn
3865 where
3866 P: ::fbthrift::ProtocolWriter,
3867 {
3868 fn write(&self, p: &mut P) {
3869 if let Self::ApplicationException(aexn) = self {
3870 return aexn.write(p);
3871 }
3872 p.write_struct_begin("DropCheckpoint");
3873 match self {
3874 Self::Success(inner) => {
3875 p.write_field_begin(
3876 "Success",
3877 ::fbthrift::TType::Struct,
3878 0i16,
3879 );
3880 inner.write(p);
3881 p.write_field_end();
3882 }
3883 Self::ApplicationException(_aexn) => unreachable!(),
3884 }
3885 p.write_field_stop();
3886 p.write_struct_end();
3887 }
3888 }
3889
3890 impl<P> ::fbthrift::Deserialize<P> for DropCheckpointExn
3891 where
3892 P: ::fbthrift::ProtocolReader,
3893 {
3894 fn read(p: &mut P) -> ::anyhow::Result<Self> {
3895 static RETURNS: &[::fbthrift::Field] = &[
3896 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
3897 ];
3898 let _ = p.read_struct_begin(|_| ())?;
3899 let mut once = false;
3900 let mut alt = ::std::option::Option::None;
3901 loop {
3902 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
3903 match ((fty, fid as ::std::primitive::i32), once) {
3904 ((::fbthrift::TType::Stop, _), _) => {
3905 p.read_field_end()?;
3906 break;
3907 }
3908 ((::fbthrift::TType::Struct, 0i32), false) => {
3909 once = true;
3910 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
3911 }
3912 ((ty, _id), false) => p.skip(ty)?,
3913 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
3914 ::fbthrift::ApplicationException::new(
3915 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
3916 format!(
3917 "unwanted extra union {} field ty {:?} id {}",
3918 "DropCheckpointExn",
3919 badty,
3920 badid,
3921 ),
3922 )
3923 )),
3924 }
3925 p.read_field_end()?;
3926 }
3927 p.read_struct_end()?;
3928 alt.ok_or_else(||
3929 ::fbthrift::ApplicationException::new(
3930 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
3931 format!("Empty union {}", "DropCheckpointExn"),
3932 )
3933 .into(),
3934 )
3935 }
3936 }
3937
3938 #[derive(Clone, Debug)]
3939 pub enum BlockingWritesExn {
3940 #[doc(hidden)]
3941 Success(crate::types::BlockingSignResp),
3942 ApplicationException(::fbthrift::ApplicationException),
3943 }
3944
3945 impl ::std::convert::From<crate::errors::storage_admin_service::BlockingWritesError> for BlockingWritesExn {
3946 fn from(err: crate::errors::storage_admin_service::BlockingWritesError) -> Self {
3947 match err {
3948 crate::errors::storage_admin_service::BlockingWritesError::ApplicationException(aexn) => BlockingWritesExn::ApplicationException(aexn),
3949 crate::errors::storage_admin_service::BlockingWritesError::ThriftError(err) => BlockingWritesExn::ApplicationException(::fbthrift::ApplicationException {
3950 message: err.to_string(),
3951 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
3952 }),
3953 }
3954 }
3955 }
3956
3957 impl ::std::convert::From<::fbthrift::ApplicationException> for BlockingWritesExn {
3958 fn from(exn: ::fbthrift::ApplicationException) -> Self {
3959 Self::ApplicationException(exn)
3960 }
3961 }
3962
3963 impl ::fbthrift::ExceptionInfo for BlockingWritesExn {
3964 fn exn_name(&self) -> &'static str {
3965 match self {
3966 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
3967 Self::ApplicationException(aexn) => aexn.exn_name(),
3968 }
3969 }
3970
3971 fn exn_value(&self) -> String {
3972 match self {
3973 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
3974 Self::ApplicationException(aexn) => aexn.exn_value(),
3975 }
3976 }
3977
3978 fn exn_is_declared(&self) -> bool {
3979 match self {
3980 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
3981 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
3982 }
3983 }
3984 }
3985
3986 impl ::fbthrift::ResultInfo for BlockingWritesExn {
3987 fn result_type(&self) -> ::fbthrift::ResultType {
3988 match self {
3989 Self::Success(_) => ::fbthrift::ResultType::Return,
3990 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
3991 }
3992 }
3993 }
3994
3995 impl ::fbthrift::GetTType for BlockingWritesExn {
3996 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
3997 }
3998
3999 impl<P> ::fbthrift::Serialize<P> for BlockingWritesExn
4000 where
4001 P: ::fbthrift::ProtocolWriter,
4002 {
4003 fn write(&self, p: &mut P) {
4004 if let Self::ApplicationException(aexn) = self {
4005 return aexn.write(p);
4006 }
4007 p.write_struct_begin("BlockingWrites");
4008 match self {
4009 Self::Success(inner) => {
4010 p.write_field_begin(
4011 "Success",
4012 ::fbthrift::TType::Struct,
4013 0i16,
4014 );
4015 inner.write(p);
4016 p.write_field_end();
4017 }
4018 Self::ApplicationException(_aexn) => unreachable!(),
4019 }
4020 p.write_field_stop();
4021 p.write_struct_end();
4022 }
4023 }
4024
4025 impl<P> ::fbthrift::Deserialize<P> for BlockingWritesExn
4026 where
4027 P: ::fbthrift::ProtocolReader,
4028 {
4029 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4030 static RETURNS: &[::fbthrift::Field] = &[
4031 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4032 ];
4033 let _ = p.read_struct_begin(|_| ())?;
4034 let mut once = false;
4035 let mut alt = ::std::option::Option::None;
4036 loop {
4037 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4038 match ((fty, fid as ::std::primitive::i32), once) {
4039 ((::fbthrift::TType::Stop, _), _) => {
4040 p.read_field_end()?;
4041 break;
4042 }
4043 ((::fbthrift::TType::Struct, 0i32), false) => {
4044 once = true;
4045 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4046 }
4047 ((ty, _id), false) => p.skip(ty)?,
4048 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4049 ::fbthrift::ApplicationException::new(
4050 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4051 format!(
4052 "unwanted extra union {} field ty {:?} id {}",
4053 "BlockingWritesExn",
4054 badty,
4055 badid,
4056 ),
4057 )
4058 )),
4059 }
4060 p.read_field_end()?;
4061 }
4062 p.read_struct_end()?;
4063 alt.ok_or_else(||
4064 ::fbthrift::ApplicationException::new(
4065 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4066 format!("Empty union {}", "BlockingWritesExn"),
4067 )
4068 .into(),
4069 )
4070 }
4071 }
4072
4073 #[derive(Clone, Debug)]
4074 pub enum GetLeaderPartsExn {
4075 #[doc(hidden)]
4076 Success(crate::types::GetLeaderPartsResp),
4077 ApplicationException(::fbthrift::ApplicationException),
4078 }
4079
4080 impl ::std::convert::From<crate::errors::storage_admin_service::GetLeaderPartsError> for GetLeaderPartsExn {
4081 fn from(err: crate::errors::storage_admin_service::GetLeaderPartsError) -> Self {
4082 match err {
4083 crate::errors::storage_admin_service::GetLeaderPartsError::ApplicationException(aexn) => GetLeaderPartsExn::ApplicationException(aexn),
4084 crate::errors::storage_admin_service::GetLeaderPartsError::ThriftError(err) => GetLeaderPartsExn::ApplicationException(::fbthrift::ApplicationException {
4085 message: err.to_string(),
4086 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4087 }),
4088 }
4089 }
4090 }
4091
4092 impl ::std::convert::From<::fbthrift::ApplicationException> for GetLeaderPartsExn {
4093 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4094 Self::ApplicationException(exn)
4095 }
4096 }
4097
4098 impl ::fbthrift::ExceptionInfo for GetLeaderPartsExn {
4099 fn exn_name(&self) -> &'static str {
4100 match self {
4101 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4102 Self::ApplicationException(aexn) => aexn.exn_name(),
4103 }
4104 }
4105
4106 fn exn_value(&self) -> String {
4107 match self {
4108 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4109 Self::ApplicationException(aexn) => aexn.exn_value(),
4110 }
4111 }
4112
4113 fn exn_is_declared(&self) -> bool {
4114 match self {
4115 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4116 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4117 }
4118 }
4119 }
4120
4121 impl ::fbthrift::ResultInfo for GetLeaderPartsExn {
4122 fn result_type(&self) -> ::fbthrift::ResultType {
4123 match self {
4124 Self::Success(_) => ::fbthrift::ResultType::Return,
4125 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4126 }
4127 }
4128 }
4129
4130 impl ::fbthrift::GetTType for GetLeaderPartsExn {
4131 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4132 }
4133
4134 impl<P> ::fbthrift::Serialize<P> for GetLeaderPartsExn
4135 where
4136 P: ::fbthrift::ProtocolWriter,
4137 {
4138 fn write(&self, p: &mut P) {
4139 if let Self::ApplicationException(aexn) = self {
4140 return aexn.write(p);
4141 }
4142 p.write_struct_begin("GetLeaderParts");
4143 match self {
4144 Self::Success(inner) => {
4145 p.write_field_begin(
4146 "Success",
4147 ::fbthrift::TType::Struct,
4148 0i16,
4149 );
4150 inner.write(p);
4151 p.write_field_end();
4152 }
4153 Self::ApplicationException(_aexn) => unreachable!(),
4154 }
4155 p.write_field_stop();
4156 p.write_struct_end();
4157 }
4158 }
4159
4160 impl<P> ::fbthrift::Deserialize<P> for GetLeaderPartsExn
4161 where
4162 P: ::fbthrift::ProtocolReader,
4163 {
4164 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4165 static RETURNS: &[::fbthrift::Field] = &[
4166 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4167 ];
4168 let _ = p.read_struct_begin(|_| ())?;
4169 let mut once = false;
4170 let mut alt = ::std::option::Option::None;
4171 loop {
4172 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4173 match ((fty, fid as ::std::primitive::i32), once) {
4174 ((::fbthrift::TType::Stop, _), _) => {
4175 p.read_field_end()?;
4176 break;
4177 }
4178 ((::fbthrift::TType::Struct, 0i32), false) => {
4179 once = true;
4180 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4181 }
4182 ((ty, _id), false) => p.skip(ty)?,
4183 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4184 ::fbthrift::ApplicationException::new(
4185 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4186 format!(
4187 "unwanted extra union {} field ty {:?} id {}",
4188 "GetLeaderPartsExn",
4189 badty,
4190 badid,
4191 ),
4192 )
4193 )),
4194 }
4195 p.read_field_end()?;
4196 }
4197 p.read_struct_end()?;
4198 alt.ok_or_else(||
4199 ::fbthrift::ApplicationException::new(
4200 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4201 format!("Empty union {}", "GetLeaderPartsExn"),
4202 )
4203 .into(),
4204 )
4205 }
4206 }
4207
4208 #[derive(Clone, Debug)]
4209 pub enum CheckPeersExn {
4210 #[doc(hidden)]
4211 Success(crate::types::AdminExecResp),
4212 ApplicationException(::fbthrift::ApplicationException),
4213 }
4214
4215 impl ::std::convert::From<crate::errors::storage_admin_service::CheckPeersError> for CheckPeersExn {
4216 fn from(err: crate::errors::storage_admin_service::CheckPeersError) -> Self {
4217 match err {
4218 crate::errors::storage_admin_service::CheckPeersError::ApplicationException(aexn) => CheckPeersExn::ApplicationException(aexn),
4219 crate::errors::storage_admin_service::CheckPeersError::ThriftError(err) => CheckPeersExn::ApplicationException(::fbthrift::ApplicationException {
4220 message: err.to_string(),
4221 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4222 }),
4223 }
4224 }
4225 }
4226
4227 impl ::std::convert::From<::fbthrift::ApplicationException> for CheckPeersExn {
4228 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4229 Self::ApplicationException(exn)
4230 }
4231 }
4232
4233 impl ::fbthrift::ExceptionInfo for CheckPeersExn {
4234 fn exn_name(&self) -> &'static str {
4235 match self {
4236 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4237 Self::ApplicationException(aexn) => aexn.exn_name(),
4238 }
4239 }
4240
4241 fn exn_value(&self) -> String {
4242 match self {
4243 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4244 Self::ApplicationException(aexn) => aexn.exn_value(),
4245 }
4246 }
4247
4248 fn exn_is_declared(&self) -> bool {
4249 match self {
4250 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4251 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4252 }
4253 }
4254 }
4255
4256 impl ::fbthrift::ResultInfo for CheckPeersExn {
4257 fn result_type(&self) -> ::fbthrift::ResultType {
4258 match self {
4259 Self::Success(_) => ::fbthrift::ResultType::Return,
4260 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4261 }
4262 }
4263 }
4264
4265 impl ::fbthrift::GetTType for CheckPeersExn {
4266 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4267 }
4268
4269 impl<P> ::fbthrift::Serialize<P> for CheckPeersExn
4270 where
4271 P: ::fbthrift::ProtocolWriter,
4272 {
4273 fn write(&self, p: &mut P) {
4274 if let Self::ApplicationException(aexn) = self {
4275 return aexn.write(p);
4276 }
4277 p.write_struct_begin("CheckPeers");
4278 match self {
4279 Self::Success(inner) => {
4280 p.write_field_begin(
4281 "Success",
4282 ::fbthrift::TType::Struct,
4283 0i16,
4284 );
4285 inner.write(p);
4286 p.write_field_end();
4287 }
4288 Self::ApplicationException(_aexn) => unreachable!(),
4289 }
4290 p.write_field_stop();
4291 p.write_struct_end();
4292 }
4293 }
4294
4295 impl<P> ::fbthrift::Deserialize<P> for CheckPeersExn
4296 where
4297 P: ::fbthrift::ProtocolReader,
4298 {
4299 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4300 static RETURNS: &[::fbthrift::Field] = &[
4301 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4302 ];
4303 let _ = p.read_struct_begin(|_| ())?;
4304 let mut once = false;
4305 let mut alt = ::std::option::Option::None;
4306 loop {
4307 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4308 match ((fty, fid as ::std::primitive::i32), once) {
4309 ((::fbthrift::TType::Stop, _), _) => {
4310 p.read_field_end()?;
4311 break;
4312 }
4313 ((::fbthrift::TType::Struct, 0i32), false) => {
4314 once = true;
4315 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4316 }
4317 ((ty, _id), false) => p.skip(ty)?,
4318 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4319 ::fbthrift::ApplicationException::new(
4320 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4321 format!(
4322 "unwanted extra union {} field ty {:?} id {}",
4323 "CheckPeersExn",
4324 badty,
4325 badid,
4326 ),
4327 )
4328 )),
4329 }
4330 p.read_field_end()?;
4331 }
4332 p.read_struct_end()?;
4333 alt.ok_or_else(||
4334 ::fbthrift::ApplicationException::new(
4335 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4336 format!("Empty union {}", "CheckPeersExn"),
4337 )
4338 .into(),
4339 )
4340 }
4341 }
4342
4343 #[derive(Clone, Debug)]
4344 pub enum AddAdminTaskExn {
4345 #[doc(hidden)]
4346 Success(crate::types::AddTaskResp),
4347 ApplicationException(::fbthrift::ApplicationException),
4348 }
4349
4350 impl ::std::convert::From<crate::errors::storage_admin_service::AddAdminTaskError> for AddAdminTaskExn {
4351 fn from(err: crate::errors::storage_admin_service::AddAdminTaskError) -> Self {
4352 match err {
4353 crate::errors::storage_admin_service::AddAdminTaskError::ApplicationException(aexn) => AddAdminTaskExn::ApplicationException(aexn),
4354 crate::errors::storage_admin_service::AddAdminTaskError::ThriftError(err) => AddAdminTaskExn::ApplicationException(::fbthrift::ApplicationException {
4355 message: err.to_string(),
4356 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4357 }),
4358 }
4359 }
4360 }
4361
4362 impl ::std::convert::From<::fbthrift::ApplicationException> for AddAdminTaskExn {
4363 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4364 Self::ApplicationException(exn)
4365 }
4366 }
4367
4368 impl ::fbthrift::ExceptionInfo for AddAdminTaskExn {
4369 fn exn_name(&self) -> &'static str {
4370 match self {
4371 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4372 Self::ApplicationException(aexn) => aexn.exn_name(),
4373 }
4374 }
4375
4376 fn exn_value(&self) -> String {
4377 match self {
4378 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4379 Self::ApplicationException(aexn) => aexn.exn_value(),
4380 }
4381 }
4382
4383 fn exn_is_declared(&self) -> bool {
4384 match self {
4385 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4386 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4387 }
4388 }
4389 }
4390
4391 impl ::fbthrift::ResultInfo for AddAdminTaskExn {
4392 fn result_type(&self) -> ::fbthrift::ResultType {
4393 match self {
4394 Self::Success(_) => ::fbthrift::ResultType::Return,
4395 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4396 }
4397 }
4398 }
4399
4400 impl ::fbthrift::GetTType for AddAdminTaskExn {
4401 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4402 }
4403
4404 impl<P> ::fbthrift::Serialize<P> for AddAdminTaskExn
4405 where
4406 P: ::fbthrift::ProtocolWriter,
4407 {
4408 fn write(&self, p: &mut P) {
4409 if let Self::ApplicationException(aexn) = self {
4410 return aexn.write(p);
4411 }
4412 p.write_struct_begin("AddAdminTask");
4413 match self {
4414 Self::Success(inner) => {
4415 p.write_field_begin(
4416 "Success",
4417 ::fbthrift::TType::Struct,
4418 0i16,
4419 );
4420 inner.write(p);
4421 p.write_field_end();
4422 }
4423 Self::ApplicationException(_aexn) => unreachable!(),
4424 }
4425 p.write_field_stop();
4426 p.write_struct_end();
4427 }
4428 }
4429
4430 impl<P> ::fbthrift::Deserialize<P> for AddAdminTaskExn
4431 where
4432 P: ::fbthrift::ProtocolReader,
4433 {
4434 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4435 static RETURNS: &[::fbthrift::Field] = &[
4436 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4437 ];
4438 let _ = p.read_struct_begin(|_| ())?;
4439 let mut once = false;
4440 let mut alt = ::std::option::Option::None;
4441 loop {
4442 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4443 match ((fty, fid as ::std::primitive::i32), once) {
4444 ((::fbthrift::TType::Stop, _), _) => {
4445 p.read_field_end()?;
4446 break;
4447 }
4448 ((::fbthrift::TType::Struct, 0i32), false) => {
4449 once = true;
4450 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4451 }
4452 ((ty, _id), false) => p.skip(ty)?,
4453 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4454 ::fbthrift::ApplicationException::new(
4455 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4456 format!(
4457 "unwanted extra union {} field ty {:?} id {}",
4458 "AddAdminTaskExn",
4459 badty,
4460 badid,
4461 ),
4462 )
4463 )),
4464 }
4465 p.read_field_end()?;
4466 }
4467 p.read_struct_end()?;
4468 alt.ok_or_else(||
4469 ::fbthrift::ApplicationException::new(
4470 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4471 format!("Empty union {}", "AddAdminTaskExn"),
4472 )
4473 .into(),
4474 )
4475 }
4476 }
4477
4478 #[derive(Clone, Debug)]
4479 pub enum StopAdminTaskExn {
4480 #[doc(hidden)]
4481 Success(crate::types::StopTaskResp),
4482 ApplicationException(::fbthrift::ApplicationException),
4483 }
4484
4485 impl ::std::convert::From<crate::errors::storage_admin_service::StopAdminTaskError> for StopAdminTaskExn {
4486 fn from(err: crate::errors::storage_admin_service::StopAdminTaskError) -> Self {
4487 match err {
4488 crate::errors::storage_admin_service::StopAdminTaskError::ApplicationException(aexn) => StopAdminTaskExn::ApplicationException(aexn),
4489 crate::errors::storage_admin_service::StopAdminTaskError::ThriftError(err) => StopAdminTaskExn::ApplicationException(::fbthrift::ApplicationException {
4490 message: err.to_string(),
4491 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4492 }),
4493 }
4494 }
4495 }
4496
4497 impl ::std::convert::From<::fbthrift::ApplicationException> for StopAdminTaskExn {
4498 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4499 Self::ApplicationException(exn)
4500 }
4501 }
4502
4503 impl ::fbthrift::ExceptionInfo for StopAdminTaskExn {
4504 fn exn_name(&self) -> &'static str {
4505 match self {
4506 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4507 Self::ApplicationException(aexn) => aexn.exn_name(),
4508 }
4509 }
4510
4511 fn exn_value(&self) -> String {
4512 match self {
4513 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4514 Self::ApplicationException(aexn) => aexn.exn_value(),
4515 }
4516 }
4517
4518 fn exn_is_declared(&self) -> bool {
4519 match self {
4520 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4521 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4522 }
4523 }
4524 }
4525
4526 impl ::fbthrift::ResultInfo for StopAdminTaskExn {
4527 fn result_type(&self) -> ::fbthrift::ResultType {
4528 match self {
4529 Self::Success(_) => ::fbthrift::ResultType::Return,
4530 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4531 }
4532 }
4533 }
4534
4535 impl ::fbthrift::GetTType for StopAdminTaskExn {
4536 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4537 }
4538
4539 impl<P> ::fbthrift::Serialize<P> for StopAdminTaskExn
4540 where
4541 P: ::fbthrift::ProtocolWriter,
4542 {
4543 fn write(&self, p: &mut P) {
4544 if let Self::ApplicationException(aexn) = self {
4545 return aexn.write(p);
4546 }
4547 p.write_struct_begin("StopAdminTask");
4548 match self {
4549 Self::Success(inner) => {
4550 p.write_field_begin(
4551 "Success",
4552 ::fbthrift::TType::Struct,
4553 0i16,
4554 );
4555 inner.write(p);
4556 p.write_field_end();
4557 }
4558 Self::ApplicationException(_aexn) => unreachable!(),
4559 }
4560 p.write_field_stop();
4561 p.write_struct_end();
4562 }
4563 }
4564
4565 impl<P> ::fbthrift::Deserialize<P> for StopAdminTaskExn
4566 where
4567 P: ::fbthrift::ProtocolReader,
4568 {
4569 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4570 static RETURNS: &[::fbthrift::Field] = &[
4571 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4572 ];
4573 let _ = p.read_struct_begin(|_| ())?;
4574 let mut once = false;
4575 let mut alt = ::std::option::Option::None;
4576 loop {
4577 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4578 match ((fty, fid as ::std::primitive::i32), once) {
4579 ((::fbthrift::TType::Stop, _), _) => {
4580 p.read_field_end()?;
4581 break;
4582 }
4583 ((::fbthrift::TType::Struct, 0i32), false) => {
4584 once = true;
4585 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4586 }
4587 ((ty, _id), false) => p.skip(ty)?,
4588 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4589 ::fbthrift::ApplicationException::new(
4590 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4591 format!(
4592 "unwanted extra union {} field ty {:?} id {}",
4593 "StopAdminTaskExn",
4594 badty,
4595 badid,
4596 ),
4597 )
4598 )),
4599 }
4600 p.read_field_end()?;
4601 }
4602 p.read_struct_end()?;
4603 alt.ok_or_else(||
4604 ::fbthrift::ApplicationException::new(
4605 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4606 format!("Empty union {}", "StopAdminTaskExn"),
4607 )
4608 .into(),
4609 )
4610 }
4611 }
4612
4613 #[derive(Clone, Debug)]
4614 pub enum ClearSpaceExn {
4615 #[doc(hidden)]
4616 Success(crate::types::ClearSpaceResp),
4617 ApplicationException(::fbthrift::ApplicationException),
4618 }
4619
4620 impl ::std::convert::From<crate::errors::storage_admin_service::ClearSpaceError> for ClearSpaceExn {
4621 fn from(err: crate::errors::storage_admin_service::ClearSpaceError) -> Self {
4622 match err {
4623 crate::errors::storage_admin_service::ClearSpaceError::ApplicationException(aexn) => ClearSpaceExn::ApplicationException(aexn),
4624 crate::errors::storage_admin_service::ClearSpaceError::ThriftError(err) => ClearSpaceExn::ApplicationException(::fbthrift::ApplicationException {
4625 message: err.to_string(),
4626 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4627 }),
4628 }
4629 }
4630 }
4631
4632 impl ::std::convert::From<::fbthrift::ApplicationException> for ClearSpaceExn {
4633 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4634 Self::ApplicationException(exn)
4635 }
4636 }
4637
4638 impl ::fbthrift::ExceptionInfo for ClearSpaceExn {
4639 fn exn_name(&self) -> &'static str {
4640 match self {
4641 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4642 Self::ApplicationException(aexn) => aexn.exn_name(),
4643 }
4644 }
4645
4646 fn exn_value(&self) -> String {
4647 match self {
4648 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4649 Self::ApplicationException(aexn) => aexn.exn_value(),
4650 }
4651 }
4652
4653 fn exn_is_declared(&self) -> bool {
4654 match self {
4655 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4656 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4657 }
4658 }
4659 }
4660
4661 impl ::fbthrift::ResultInfo for ClearSpaceExn {
4662 fn result_type(&self) -> ::fbthrift::ResultType {
4663 match self {
4664 Self::Success(_) => ::fbthrift::ResultType::Return,
4665 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4666 }
4667 }
4668 }
4669
4670 impl ::fbthrift::GetTType for ClearSpaceExn {
4671 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4672 }
4673
4674 impl<P> ::fbthrift::Serialize<P> for ClearSpaceExn
4675 where
4676 P: ::fbthrift::ProtocolWriter,
4677 {
4678 fn write(&self, p: &mut P) {
4679 if let Self::ApplicationException(aexn) = self {
4680 return aexn.write(p);
4681 }
4682 p.write_struct_begin("ClearSpace");
4683 match self {
4684 Self::Success(inner) => {
4685 p.write_field_begin(
4686 "Success",
4687 ::fbthrift::TType::Struct,
4688 0i16,
4689 );
4690 inner.write(p);
4691 p.write_field_end();
4692 }
4693 Self::ApplicationException(_aexn) => unreachable!(),
4694 }
4695 p.write_field_stop();
4696 p.write_struct_end();
4697 }
4698 }
4699
4700 impl<P> ::fbthrift::Deserialize<P> for ClearSpaceExn
4701 where
4702 P: ::fbthrift::ProtocolReader,
4703 {
4704 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4705 static RETURNS: &[::fbthrift::Field] = &[
4706 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4707 ];
4708 let _ = p.read_struct_begin(|_| ())?;
4709 let mut once = false;
4710 let mut alt = ::std::option::Option::None;
4711 loop {
4712 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4713 match ((fty, fid as ::std::primitive::i32), once) {
4714 ((::fbthrift::TType::Stop, _), _) => {
4715 p.read_field_end()?;
4716 break;
4717 }
4718 ((::fbthrift::TType::Struct, 0i32), false) => {
4719 once = true;
4720 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4721 }
4722 ((ty, _id), false) => p.skip(ty)?,
4723 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4724 ::fbthrift::ApplicationException::new(
4725 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4726 format!(
4727 "unwanted extra union {} field ty {:?} id {}",
4728 "ClearSpaceExn",
4729 badty,
4730 badid,
4731 ),
4732 )
4733 )),
4734 }
4735 p.read_field_end()?;
4736 }
4737 p.read_struct_end()?;
4738 alt.ok_or_else(||
4739 ::fbthrift::ApplicationException::new(
4740 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4741 format!("Empty union {}", "ClearSpaceExn"),
4742 )
4743 .into(),
4744 )
4745 }
4746 }
4747 }
4748
4749 pub mod internal_storage_service {
4750 #[derive(Clone, Debug)]
4751 pub enum ChainAddEdgesExn {
4752 #[doc(hidden)]
4753 Success(crate::types::ExecResponse),
4754 ApplicationException(::fbthrift::ApplicationException),
4755 }
4756
4757 impl ::std::convert::From<crate::errors::internal_storage_service::ChainAddEdgesError> for ChainAddEdgesExn {
4758 fn from(err: crate::errors::internal_storage_service::ChainAddEdgesError) -> Self {
4759 match err {
4760 crate::errors::internal_storage_service::ChainAddEdgesError::ApplicationException(aexn) => ChainAddEdgesExn::ApplicationException(aexn),
4761 crate::errors::internal_storage_service::ChainAddEdgesError::ThriftError(err) => ChainAddEdgesExn::ApplicationException(::fbthrift::ApplicationException {
4762 message: err.to_string(),
4763 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4764 }),
4765 }
4766 }
4767 }
4768
4769 impl ::std::convert::From<::fbthrift::ApplicationException> for ChainAddEdgesExn {
4770 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4771 Self::ApplicationException(exn)
4772 }
4773 }
4774
4775 impl ::fbthrift::ExceptionInfo for ChainAddEdgesExn {
4776 fn exn_name(&self) -> &'static str {
4777 match self {
4778 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4779 Self::ApplicationException(aexn) => aexn.exn_name(),
4780 }
4781 }
4782
4783 fn exn_value(&self) -> String {
4784 match self {
4785 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4786 Self::ApplicationException(aexn) => aexn.exn_value(),
4787 }
4788 }
4789
4790 fn exn_is_declared(&self) -> bool {
4791 match self {
4792 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4793 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4794 }
4795 }
4796 }
4797
4798 impl ::fbthrift::ResultInfo for ChainAddEdgesExn {
4799 fn result_type(&self) -> ::fbthrift::ResultType {
4800 match self {
4801 Self::Success(_) => ::fbthrift::ResultType::Return,
4802 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4803 }
4804 }
4805 }
4806
4807 impl ::fbthrift::GetTType for ChainAddEdgesExn {
4808 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4809 }
4810
4811 impl<P> ::fbthrift::Serialize<P> for ChainAddEdgesExn
4812 where
4813 P: ::fbthrift::ProtocolWriter,
4814 {
4815 fn write(&self, p: &mut P) {
4816 if let Self::ApplicationException(aexn) = self {
4817 return aexn.write(p);
4818 }
4819 p.write_struct_begin("ChainAddEdges");
4820 match self {
4821 Self::Success(inner) => {
4822 p.write_field_begin(
4823 "Success",
4824 ::fbthrift::TType::Struct,
4825 0i16,
4826 );
4827 inner.write(p);
4828 p.write_field_end();
4829 }
4830 Self::ApplicationException(_aexn) => unreachable!(),
4831 }
4832 p.write_field_stop();
4833 p.write_struct_end();
4834 }
4835 }
4836
4837 impl<P> ::fbthrift::Deserialize<P> for ChainAddEdgesExn
4838 where
4839 P: ::fbthrift::ProtocolReader,
4840 {
4841 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4842 static RETURNS: &[::fbthrift::Field] = &[
4843 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4844 ];
4845 let _ = p.read_struct_begin(|_| ())?;
4846 let mut once = false;
4847 let mut alt = ::std::option::Option::None;
4848 loop {
4849 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4850 match ((fty, fid as ::std::primitive::i32), once) {
4851 ((::fbthrift::TType::Stop, _), _) => {
4852 p.read_field_end()?;
4853 break;
4854 }
4855 ((::fbthrift::TType::Struct, 0i32), false) => {
4856 once = true;
4857 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4858 }
4859 ((ty, _id), false) => p.skip(ty)?,
4860 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4861 ::fbthrift::ApplicationException::new(
4862 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4863 format!(
4864 "unwanted extra union {} field ty {:?} id {}",
4865 "ChainAddEdgesExn",
4866 badty,
4867 badid,
4868 ),
4869 )
4870 )),
4871 }
4872 p.read_field_end()?;
4873 }
4874 p.read_struct_end()?;
4875 alt.ok_or_else(||
4876 ::fbthrift::ApplicationException::new(
4877 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
4878 format!("Empty union {}", "ChainAddEdgesExn"),
4879 )
4880 .into(),
4881 )
4882 }
4883 }
4884
4885 #[derive(Clone, Debug)]
4886 pub enum ChainUpdateEdgeExn {
4887 #[doc(hidden)]
4888 Success(crate::types::UpdateResponse),
4889 ApplicationException(::fbthrift::ApplicationException),
4890 }
4891
4892 impl ::std::convert::From<crate::errors::internal_storage_service::ChainUpdateEdgeError> for ChainUpdateEdgeExn {
4893 fn from(err: crate::errors::internal_storage_service::ChainUpdateEdgeError) -> Self {
4894 match err {
4895 crate::errors::internal_storage_service::ChainUpdateEdgeError::ApplicationException(aexn) => ChainUpdateEdgeExn::ApplicationException(aexn),
4896 crate::errors::internal_storage_service::ChainUpdateEdgeError::ThriftError(err) => ChainUpdateEdgeExn::ApplicationException(::fbthrift::ApplicationException {
4897 message: err.to_string(),
4898 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
4899 }),
4900 }
4901 }
4902 }
4903
4904 impl ::std::convert::From<::fbthrift::ApplicationException> for ChainUpdateEdgeExn {
4905 fn from(exn: ::fbthrift::ApplicationException) -> Self {
4906 Self::ApplicationException(exn)
4907 }
4908 }
4909
4910 impl ::fbthrift::ExceptionInfo for ChainUpdateEdgeExn {
4911 fn exn_name(&self) -> &'static str {
4912 match self {
4913 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
4914 Self::ApplicationException(aexn) => aexn.exn_name(),
4915 }
4916 }
4917
4918 fn exn_value(&self) -> String {
4919 match self {
4920 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
4921 Self::ApplicationException(aexn) => aexn.exn_value(),
4922 }
4923 }
4924
4925 fn exn_is_declared(&self) -> bool {
4926 match self {
4927 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
4928 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
4929 }
4930 }
4931 }
4932
4933 impl ::fbthrift::ResultInfo for ChainUpdateEdgeExn {
4934 fn result_type(&self) -> ::fbthrift::ResultType {
4935 match self {
4936 Self::Success(_) => ::fbthrift::ResultType::Return,
4937 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
4938 }
4939 }
4940 }
4941
4942 impl ::fbthrift::GetTType for ChainUpdateEdgeExn {
4943 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
4944 }
4945
4946 impl<P> ::fbthrift::Serialize<P> for ChainUpdateEdgeExn
4947 where
4948 P: ::fbthrift::ProtocolWriter,
4949 {
4950 fn write(&self, p: &mut P) {
4951 if let Self::ApplicationException(aexn) = self {
4952 return aexn.write(p);
4953 }
4954 p.write_struct_begin("ChainUpdateEdge");
4955 match self {
4956 Self::Success(inner) => {
4957 p.write_field_begin(
4958 "Success",
4959 ::fbthrift::TType::Struct,
4960 0i16,
4961 );
4962 inner.write(p);
4963 p.write_field_end();
4964 }
4965 Self::ApplicationException(_aexn) => unreachable!(),
4966 }
4967 p.write_field_stop();
4968 p.write_struct_end();
4969 }
4970 }
4971
4972 impl<P> ::fbthrift::Deserialize<P> for ChainUpdateEdgeExn
4973 where
4974 P: ::fbthrift::ProtocolReader,
4975 {
4976 fn read(p: &mut P) -> ::anyhow::Result<Self> {
4977 static RETURNS: &[::fbthrift::Field] = &[
4978 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
4979 ];
4980 let _ = p.read_struct_begin(|_| ())?;
4981 let mut once = false;
4982 let mut alt = ::std::option::Option::None;
4983 loop {
4984 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
4985 match ((fty, fid as ::std::primitive::i32), once) {
4986 ((::fbthrift::TType::Stop, _), _) => {
4987 p.read_field_end()?;
4988 break;
4989 }
4990 ((::fbthrift::TType::Struct, 0i32), false) => {
4991 once = true;
4992 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
4993 }
4994 ((ty, _id), false) => p.skip(ty)?,
4995 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
4996 ::fbthrift::ApplicationException::new(
4997 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
4998 format!(
4999 "unwanted extra union {} field ty {:?} id {}",
5000 "ChainUpdateEdgeExn",
5001 badty,
5002 badid,
5003 ),
5004 )
5005 )),
5006 }
5007 p.read_field_end()?;
5008 }
5009 p.read_struct_end()?;
5010 alt.ok_or_else(||
5011 ::fbthrift::ApplicationException::new(
5012 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
5013 format!("Empty union {}", "ChainUpdateEdgeExn"),
5014 )
5015 .into(),
5016 )
5017 }
5018 }
5019
5020 #[derive(Clone, Debug)]
5021 pub enum ChainDeleteEdgesExn {
5022 #[doc(hidden)]
5023 Success(crate::types::ExecResponse),
5024 ApplicationException(::fbthrift::ApplicationException),
5025 }
5026
5027 impl ::std::convert::From<crate::errors::internal_storage_service::ChainDeleteEdgesError> for ChainDeleteEdgesExn {
5028 fn from(err: crate::errors::internal_storage_service::ChainDeleteEdgesError) -> Self {
5029 match err {
5030 crate::errors::internal_storage_service::ChainDeleteEdgesError::ApplicationException(aexn) => ChainDeleteEdgesExn::ApplicationException(aexn),
5031 crate::errors::internal_storage_service::ChainDeleteEdgesError::ThriftError(err) => ChainDeleteEdgesExn::ApplicationException(::fbthrift::ApplicationException {
5032 message: err.to_string(),
5033 type_: ::fbthrift::ApplicationExceptionErrorCode::InternalError,
5034 }),
5035 }
5036 }
5037 }
5038
5039 impl ::std::convert::From<::fbthrift::ApplicationException> for ChainDeleteEdgesExn {
5040 fn from(exn: ::fbthrift::ApplicationException) -> Self {
5041 Self::ApplicationException(exn)
5042 }
5043 }
5044
5045 impl ::fbthrift::ExceptionInfo for ChainDeleteEdgesExn {
5046 fn exn_name(&self) -> &'static str {
5047 match self {
5048 Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
5049 Self::ApplicationException(aexn) => aexn.exn_name(),
5050 }
5051 }
5052
5053 fn exn_value(&self) -> String {
5054 match self {
5055 Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
5056 Self::ApplicationException(aexn) => aexn.exn_value(),
5057 }
5058 }
5059
5060 fn exn_is_declared(&self) -> bool {
5061 match self {
5062 Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
5063 Self::ApplicationException(aexn) => aexn.exn_is_declared(),
5064 }
5065 }
5066 }
5067
5068 impl ::fbthrift::ResultInfo for ChainDeleteEdgesExn {
5069 fn result_type(&self) -> ::fbthrift::ResultType {
5070 match self {
5071 Self::Success(_) => ::fbthrift::ResultType::Return,
5072 Self::ApplicationException(_aexn) => ::fbthrift::ResultType::Exception,
5073 }
5074 }
5075 }
5076
5077 impl ::fbthrift::GetTType for ChainDeleteEdgesExn {
5078 const TTYPE: ::fbthrift::TType = ::fbthrift::TType::Struct;
5079 }
5080
5081 impl<P> ::fbthrift::Serialize<P> for ChainDeleteEdgesExn
5082 where
5083 P: ::fbthrift::ProtocolWriter,
5084 {
5085 fn write(&self, p: &mut P) {
5086 if let Self::ApplicationException(aexn) = self {
5087 return aexn.write(p);
5088 }
5089 p.write_struct_begin("ChainDeleteEdges");
5090 match self {
5091 Self::Success(inner) => {
5092 p.write_field_begin(
5093 "Success",
5094 ::fbthrift::TType::Struct,
5095 0i16,
5096 );
5097 inner.write(p);
5098 p.write_field_end();
5099 }
5100 Self::ApplicationException(_aexn) => unreachable!(),
5101 }
5102 p.write_field_stop();
5103 p.write_struct_end();
5104 }
5105 }
5106
5107 impl<P> ::fbthrift::Deserialize<P> for ChainDeleteEdgesExn
5108 where
5109 P: ::fbthrift::ProtocolReader,
5110 {
5111 fn read(p: &mut P) -> ::anyhow::Result<Self> {
5112 static RETURNS: &[::fbthrift::Field] = &[
5113 ::fbthrift::Field::new("Success", ::fbthrift::TType::Struct, 0),
5114 ];
5115 let _ = p.read_struct_begin(|_| ())?;
5116 let mut once = false;
5117 let mut alt = ::std::option::Option::None;
5118 loop {
5119 let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
5120 match ((fty, fid as ::std::primitive::i32), once) {
5121 ((::fbthrift::TType::Stop, _), _) => {
5122 p.read_field_end()?;
5123 break;
5124 }
5125 ((::fbthrift::TType::Struct, 0i32), false) => {
5126 once = true;
5127 alt = ::std::option::Option::Some(Self::Success(::fbthrift::Deserialize::read(p)?));
5128 }
5129 ((ty, _id), false) => p.skip(ty)?,
5130 ((badty, badid), true) => return ::std::result::Result::Err(::std::convert::From::from(
5131 ::fbthrift::ApplicationException::new(
5132 ::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
5133 format!(
5134 "unwanted extra union {} field ty {:?} id {}",
5135 "ChainDeleteEdgesExn",
5136 badty,
5137 badid,
5138 ),
5139 )
5140 )),
5141 }
5142 p.read_field_end()?;
5143 }
5144 p.read_struct_end()?;
5145 alt.ok_or_else(||
5146 ::fbthrift::ApplicationException::new(
5147 ::fbthrift::ApplicationExceptionErrorCode::MissingResult,
5148 format!("Empty union {}", "ChainDeleteEdgesExn"),
5149 )
5150 .into(),
5151 )
5152 }
5153 }
5154 }
5155}
5156
5157pub mod client {
5159
5160 pub struct GraphStorageServiceImpl<P, T, S = ::fbthrift::NoopSpawner> {
5161 transport: T,
5162 _phantom: ::std::marker::PhantomData<fn() -> (P, S)>,
5163 }
5164
5165 impl<P, T, S> GraphStorageServiceImpl<P, T, S>
5166 where
5167 P: ::fbthrift::Protocol,
5168 T: ::fbthrift::Transport,
5169 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
5170 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
5171 P::Deserializer: ::std::marker::Send,
5172 S: ::fbthrift::help::Spawner,
5173 {
5174 pub fn new(
5175 transport: T,
5176 ) -> Self {
5177 Self {
5178 transport,
5179 _phantom: ::std::marker::PhantomData,
5180 }
5181 }
5182
5183 pub fn transport(&self) -> &T {
5184 &self.transport
5185 }
5186
5187
5188 fn _getNeighbors_impl(
5189 &self,
5190 arg_req: &crate::types::GetNeighborsRequest,
5191 rpc_options: T::RpcOptions,
5192 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>> {
5193 use ::const_cstr::const_cstr;
5194 use ::tracing::Instrument as _;
5195 use ::futures::FutureExt as _;
5196
5197 const_cstr! {
5198 SERVICE_NAME = "GraphStorageService";
5199 METHOD_NAME = "GraphStorageService.getNeighbors";
5200 }
5201 let args = self::Args_GraphStorageService_getNeighbors {
5202 req: arg_req,
5203 _phantom: ::std::marker::PhantomData,
5204 };
5205
5206 let transport = self.transport();
5207
5208 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("getNeighbors", &args) {
5210 ::std::result::Result::Ok(res) => res,
5211 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5212 };
5213
5214 let call = transport
5215 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5216 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.getNeighbors"));
5217
5218 async move {
5219 let reply_env = call.await?;
5220
5221 let de = P::deserializer(reply_env);
5222 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::GetNeighborsExn, _>, _) =
5223 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5224
5225 let res = match res {
5226 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5227 ::std::result::Result::Err(aexn) =>
5228 ::std::result::Result::Err(crate::errors::graph_storage_service::GetNeighborsError::ApplicationException(aexn))
5229 };
5230 res
5231 }
5232 .instrument(::tracing::info_span!("GraphStorageService.getNeighbors"))
5233 .boxed()
5234 }
5235
5236 fn _getDstBySrc_impl(
5237 &self,
5238 arg_req: &crate::types::GetDstBySrcRequest,
5239 rpc_options: T::RpcOptions,
5240 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>> {
5241 use ::const_cstr::const_cstr;
5242 use ::tracing::Instrument as _;
5243 use ::futures::FutureExt as _;
5244
5245 const_cstr! {
5246 SERVICE_NAME = "GraphStorageService";
5247 METHOD_NAME = "GraphStorageService.getDstBySrc";
5248 }
5249 let args = self::Args_GraphStorageService_getDstBySrc {
5250 req: arg_req,
5251 _phantom: ::std::marker::PhantomData,
5252 };
5253
5254 let transport = self.transport();
5255
5256 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("getDstBySrc", &args) {
5258 ::std::result::Result::Ok(res) => res,
5259 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5260 };
5261
5262 let call = transport
5263 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5264 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.getDstBySrc"));
5265
5266 async move {
5267 let reply_env = call.await?;
5268
5269 let de = P::deserializer(reply_env);
5270 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::GetDstBySrcExn, _>, _) =
5271 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5272
5273 let res = match res {
5274 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5275 ::std::result::Result::Err(aexn) =>
5276 ::std::result::Result::Err(crate::errors::graph_storage_service::GetDstBySrcError::ApplicationException(aexn))
5277 };
5278 res
5279 }
5280 .instrument(::tracing::info_span!("GraphStorageService.getDstBySrc"))
5281 .boxed()
5282 }
5283
5284 fn _getProps_impl(
5285 &self,
5286 arg_req: &crate::types::GetPropRequest,
5287 rpc_options: T::RpcOptions,
5288 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>> {
5289 use ::const_cstr::const_cstr;
5290 use ::tracing::Instrument as _;
5291 use ::futures::FutureExt as _;
5292
5293 const_cstr! {
5294 SERVICE_NAME = "GraphStorageService";
5295 METHOD_NAME = "GraphStorageService.getProps";
5296 }
5297 let args = self::Args_GraphStorageService_getProps {
5298 req: arg_req,
5299 _phantom: ::std::marker::PhantomData,
5300 };
5301
5302 let transport = self.transport();
5303
5304 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("getProps", &args) {
5306 ::std::result::Result::Ok(res) => res,
5307 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5308 };
5309
5310 let call = transport
5311 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5312 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.getProps"));
5313
5314 async move {
5315 let reply_env = call.await?;
5316
5317 let de = P::deserializer(reply_env);
5318 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::GetPropsExn, _>, _) =
5319 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5320
5321 let res = match res {
5322 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5323 ::std::result::Result::Err(aexn) =>
5324 ::std::result::Result::Err(crate::errors::graph_storage_service::GetPropsError::ApplicationException(aexn))
5325 };
5326 res
5327 }
5328 .instrument(::tracing::info_span!("GraphStorageService.getProps"))
5329 .boxed()
5330 }
5331
5332 fn _addVertices_impl(
5333 &self,
5334 arg_req: &crate::types::AddVerticesRequest,
5335 rpc_options: T::RpcOptions,
5336 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>> {
5337 use ::const_cstr::const_cstr;
5338 use ::tracing::Instrument as _;
5339 use ::futures::FutureExt as _;
5340
5341 const_cstr! {
5342 SERVICE_NAME = "GraphStorageService";
5343 METHOD_NAME = "GraphStorageService.addVertices";
5344 }
5345 let args = self::Args_GraphStorageService_addVertices {
5346 req: arg_req,
5347 _phantom: ::std::marker::PhantomData,
5348 };
5349
5350 let transport = self.transport();
5351
5352 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("addVertices", &args) {
5354 ::std::result::Result::Ok(res) => res,
5355 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5356 };
5357
5358 let call = transport
5359 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5360 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.addVertices"));
5361
5362 async move {
5363 let reply_env = call.await?;
5364
5365 let de = P::deserializer(reply_env);
5366 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::AddVerticesExn, _>, _) =
5367 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5368
5369 let res = match res {
5370 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5371 ::std::result::Result::Err(aexn) =>
5372 ::std::result::Result::Err(crate::errors::graph_storage_service::AddVerticesError::ApplicationException(aexn))
5373 };
5374 res
5375 }
5376 .instrument(::tracing::info_span!("GraphStorageService.addVertices"))
5377 .boxed()
5378 }
5379
5380 fn _addEdges_impl(
5381 &self,
5382 arg_req: &crate::types::AddEdgesRequest,
5383 rpc_options: T::RpcOptions,
5384 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>> {
5385 use ::const_cstr::const_cstr;
5386 use ::tracing::Instrument as _;
5387 use ::futures::FutureExt as _;
5388
5389 const_cstr! {
5390 SERVICE_NAME = "GraphStorageService";
5391 METHOD_NAME = "GraphStorageService.addEdges";
5392 }
5393 let args = self::Args_GraphStorageService_addEdges {
5394 req: arg_req,
5395 _phantom: ::std::marker::PhantomData,
5396 };
5397
5398 let transport = self.transport();
5399
5400 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("addEdges", &args) {
5402 ::std::result::Result::Ok(res) => res,
5403 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5404 };
5405
5406 let call = transport
5407 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5408 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.addEdges"));
5409
5410 async move {
5411 let reply_env = call.await?;
5412
5413 let de = P::deserializer(reply_env);
5414 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::AddEdgesExn, _>, _) =
5415 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5416
5417 let res = match res {
5418 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5419 ::std::result::Result::Err(aexn) =>
5420 ::std::result::Result::Err(crate::errors::graph_storage_service::AddEdgesError::ApplicationException(aexn))
5421 };
5422 res
5423 }
5424 .instrument(::tracing::info_span!("GraphStorageService.addEdges"))
5425 .boxed()
5426 }
5427
5428 fn _deleteEdges_impl(
5429 &self,
5430 arg_req: &crate::types::DeleteEdgesRequest,
5431 rpc_options: T::RpcOptions,
5432 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>> {
5433 use ::const_cstr::const_cstr;
5434 use ::tracing::Instrument as _;
5435 use ::futures::FutureExt as _;
5436
5437 const_cstr! {
5438 SERVICE_NAME = "GraphStorageService";
5439 METHOD_NAME = "GraphStorageService.deleteEdges";
5440 }
5441 let args = self::Args_GraphStorageService_deleteEdges {
5442 req: arg_req,
5443 _phantom: ::std::marker::PhantomData,
5444 };
5445
5446 let transport = self.transport();
5447
5448 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("deleteEdges", &args) {
5450 ::std::result::Result::Ok(res) => res,
5451 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5452 };
5453
5454 let call = transport
5455 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5456 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.deleteEdges"));
5457
5458 async move {
5459 let reply_env = call.await?;
5460
5461 let de = P::deserializer(reply_env);
5462 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::DeleteEdgesExn, _>, _) =
5463 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5464
5465 let res = match res {
5466 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5467 ::std::result::Result::Err(aexn) =>
5468 ::std::result::Result::Err(crate::errors::graph_storage_service::DeleteEdgesError::ApplicationException(aexn))
5469 };
5470 res
5471 }
5472 .instrument(::tracing::info_span!("GraphStorageService.deleteEdges"))
5473 .boxed()
5474 }
5475
5476 fn _deleteVertices_impl(
5477 &self,
5478 arg_req: &crate::types::DeleteVerticesRequest,
5479 rpc_options: T::RpcOptions,
5480 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>> {
5481 use ::const_cstr::const_cstr;
5482 use ::tracing::Instrument as _;
5483 use ::futures::FutureExt as _;
5484
5485 const_cstr! {
5486 SERVICE_NAME = "GraphStorageService";
5487 METHOD_NAME = "GraphStorageService.deleteVertices";
5488 }
5489 let args = self::Args_GraphStorageService_deleteVertices {
5490 req: arg_req,
5491 _phantom: ::std::marker::PhantomData,
5492 };
5493
5494 let transport = self.transport();
5495
5496 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("deleteVertices", &args) {
5498 ::std::result::Result::Ok(res) => res,
5499 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5500 };
5501
5502 let call = transport
5503 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5504 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.deleteVertices"));
5505
5506 async move {
5507 let reply_env = call.await?;
5508
5509 let de = P::deserializer(reply_env);
5510 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::DeleteVerticesExn, _>, _) =
5511 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5512
5513 let res = match res {
5514 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5515 ::std::result::Result::Err(aexn) =>
5516 ::std::result::Result::Err(crate::errors::graph_storage_service::DeleteVerticesError::ApplicationException(aexn))
5517 };
5518 res
5519 }
5520 .instrument(::tracing::info_span!("GraphStorageService.deleteVertices"))
5521 .boxed()
5522 }
5523
5524 fn _deleteTags_impl(
5525 &self,
5526 arg_req: &crate::types::DeleteTagsRequest,
5527 rpc_options: T::RpcOptions,
5528 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>> {
5529 use ::const_cstr::const_cstr;
5530 use ::tracing::Instrument as _;
5531 use ::futures::FutureExt as _;
5532
5533 const_cstr! {
5534 SERVICE_NAME = "GraphStorageService";
5535 METHOD_NAME = "GraphStorageService.deleteTags";
5536 }
5537 let args = self::Args_GraphStorageService_deleteTags {
5538 req: arg_req,
5539 _phantom: ::std::marker::PhantomData,
5540 };
5541
5542 let transport = self.transport();
5543
5544 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("deleteTags", &args) {
5546 ::std::result::Result::Ok(res) => res,
5547 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5548 };
5549
5550 let call = transport
5551 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5552 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.deleteTags"));
5553
5554 async move {
5555 let reply_env = call.await?;
5556
5557 let de = P::deserializer(reply_env);
5558 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::DeleteTagsExn, _>, _) =
5559 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5560
5561 let res = match res {
5562 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5563 ::std::result::Result::Err(aexn) =>
5564 ::std::result::Result::Err(crate::errors::graph_storage_service::DeleteTagsError::ApplicationException(aexn))
5565 };
5566 res
5567 }
5568 .instrument(::tracing::info_span!("GraphStorageService.deleteTags"))
5569 .boxed()
5570 }
5571
5572 fn _updateVertex_impl(
5573 &self,
5574 arg_req: &crate::types::UpdateVertexRequest,
5575 rpc_options: T::RpcOptions,
5576 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>> {
5577 use ::const_cstr::const_cstr;
5578 use ::tracing::Instrument as _;
5579 use ::futures::FutureExt as _;
5580
5581 const_cstr! {
5582 SERVICE_NAME = "GraphStorageService";
5583 METHOD_NAME = "GraphStorageService.updateVertex";
5584 }
5585 let args = self::Args_GraphStorageService_updateVertex {
5586 req: arg_req,
5587 _phantom: ::std::marker::PhantomData,
5588 };
5589
5590 let transport = self.transport();
5591
5592 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("updateVertex", &args) {
5594 ::std::result::Result::Ok(res) => res,
5595 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5596 };
5597
5598 let call = transport
5599 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5600 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.updateVertex"));
5601
5602 async move {
5603 let reply_env = call.await?;
5604
5605 let de = P::deserializer(reply_env);
5606 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::UpdateVertexExn, _>, _) =
5607 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5608
5609 let res = match res {
5610 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5611 ::std::result::Result::Err(aexn) =>
5612 ::std::result::Result::Err(crate::errors::graph_storage_service::UpdateVertexError::ApplicationException(aexn))
5613 };
5614 res
5615 }
5616 .instrument(::tracing::info_span!("GraphStorageService.updateVertex"))
5617 .boxed()
5618 }
5619
5620 fn _updateEdge_impl(
5621 &self,
5622 arg_req: &crate::types::UpdateEdgeRequest,
5623 rpc_options: T::RpcOptions,
5624 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>> {
5625 use ::const_cstr::const_cstr;
5626 use ::tracing::Instrument as _;
5627 use ::futures::FutureExt as _;
5628
5629 const_cstr! {
5630 SERVICE_NAME = "GraphStorageService";
5631 METHOD_NAME = "GraphStorageService.updateEdge";
5632 }
5633 let args = self::Args_GraphStorageService_updateEdge {
5634 req: arg_req,
5635 _phantom: ::std::marker::PhantomData,
5636 };
5637
5638 let transport = self.transport();
5639
5640 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("updateEdge", &args) {
5642 ::std::result::Result::Ok(res) => res,
5643 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5644 };
5645
5646 let call = transport
5647 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5648 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.updateEdge"));
5649
5650 async move {
5651 let reply_env = call.await?;
5652
5653 let de = P::deserializer(reply_env);
5654 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::UpdateEdgeExn, _>, _) =
5655 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5656
5657 let res = match res {
5658 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5659 ::std::result::Result::Err(aexn) =>
5660 ::std::result::Result::Err(crate::errors::graph_storage_service::UpdateEdgeError::ApplicationException(aexn))
5661 };
5662 res
5663 }
5664 .instrument(::tracing::info_span!("GraphStorageService.updateEdge"))
5665 .boxed()
5666 }
5667
5668 fn _scanVertex_impl(
5669 &self,
5670 arg_req: &crate::types::ScanVertexRequest,
5671 rpc_options: T::RpcOptions,
5672 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>> {
5673 use ::const_cstr::const_cstr;
5674 use ::tracing::Instrument as _;
5675 use ::futures::FutureExt as _;
5676
5677 const_cstr! {
5678 SERVICE_NAME = "GraphStorageService";
5679 METHOD_NAME = "GraphStorageService.scanVertex";
5680 }
5681 let args = self::Args_GraphStorageService_scanVertex {
5682 req: arg_req,
5683 _phantom: ::std::marker::PhantomData,
5684 };
5685
5686 let transport = self.transport();
5687
5688 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("scanVertex", &args) {
5690 ::std::result::Result::Ok(res) => res,
5691 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5692 };
5693
5694 let call = transport
5695 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5696 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.scanVertex"));
5697
5698 async move {
5699 let reply_env = call.await?;
5700
5701 let de = P::deserializer(reply_env);
5702 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::ScanVertexExn, _>, _) =
5703 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5704
5705 let res = match res {
5706 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5707 ::std::result::Result::Err(aexn) =>
5708 ::std::result::Result::Err(crate::errors::graph_storage_service::ScanVertexError::ApplicationException(aexn))
5709 };
5710 res
5711 }
5712 .instrument(::tracing::info_span!("GraphStorageService.scanVertex"))
5713 .boxed()
5714 }
5715
5716 fn _scanEdge_impl(
5717 &self,
5718 arg_req: &crate::types::ScanEdgeRequest,
5719 rpc_options: T::RpcOptions,
5720 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>> {
5721 use ::const_cstr::const_cstr;
5722 use ::tracing::Instrument as _;
5723 use ::futures::FutureExt as _;
5724
5725 const_cstr! {
5726 SERVICE_NAME = "GraphStorageService";
5727 METHOD_NAME = "GraphStorageService.scanEdge";
5728 }
5729 let args = self::Args_GraphStorageService_scanEdge {
5730 req: arg_req,
5731 _phantom: ::std::marker::PhantomData,
5732 };
5733
5734 let transport = self.transport();
5735
5736 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("scanEdge", &args) {
5738 ::std::result::Result::Ok(res) => res,
5739 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5740 };
5741
5742 let call = transport
5743 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5744 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.scanEdge"));
5745
5746 async move {
5747 let reply_env = call.await?;
5748
5749 let de = P::deserializer(reply_env);
5750 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::ScanEdgeExn, _>, _) =
5751 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5752
5753 let res = match res {
5754 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5755 ::std::result::Result::Err(aexn) =>
5756 ::std::result::Result::Err(crate::errors::graph_storage_service::ScanEdgeError::ApplicationException(aexn))
5757 };
5758 res
5759 }
5760 .instrument(::tracing::info_span!("GraphStorageService.scanEdge"))
5761 .boxed()
5762 }
5763
5764 fn _getUUID_impl(
5765 &self,
5766 arg_req: &crate::types::GetUUIDReq,
5767 rpc_options: T::RpcOptions,
5768 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>> {
5769 use ::const_cstr::const_cstr;
5770 use ::tracing::Instrument as _;
5771 use ::futures::FutureExt as _;
5772
5773 const_cstr! {
5774 SERVICE_NAME = "GraphStorageService";
5775 METHOD_NAME = "GraphStorageService.getUUID";
5776 }
5777 let args = self::Args_GraphStorageService_getUUID {
5778 req: arg_req,
5779 _phantom: ::std::marker::PhantomData,
5780 };
5781
5782 let transport = self.transport();
5783
5784 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("getUUID", &args) {
5786 ::std::result::Result::Ok(res) => res,
5787 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5788 };
5789
5790 let call = transport
5791 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5792 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.getUUID"));
5793
5794 async move {
5795 let reply_env = call.await?;
5796
5797 let de = P::deserializer(reply_env);
5798 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::GetUUIDExn, _>, _) =
5799 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5800
5801 let res = match res {
5802 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5803 ::std::result::Result::Err(aexn) =>
5804 ::std::result::Result::Err(crate::errors::graph_storage_service::GetUUIDError::ApplicationException(aexn))
5805 };
5806 res
5807 }
5808 .instrument(::tracing::info_span!("GraphStorageService.getUUID"))
5809 .boxed()
5810 }
5811
5812 fn _lookupIndex_impl(
5813 &self,
5814 arg_req: &crate::types::LookupIndexRequest,
5815 rpc_options: T::RpcOptions,
5816 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>> {
5817 use ::const_cstr::const_cstr;
5818 use ::tracing::Instrument as _;
5819 use ::futures::FutureExt as _;
5820
5821 const_cstr! {
5822 SERVICE_NAME = "GraphStorageService";
5823 METHOD_NAME = "GraphStorageService.lookupIndex";
5824 }
5825 let args = self::Args_GraphStorageService_lookupIndex {
5826 req: arg_req,
5827 _phantom: ::std::marker::PhantomData,
5828 };
5829
5830 let transport = self.transport();
5831
5832 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("lookupIndex", &args) {
5834 ::std::result::Result::Ok(res) => res,
5835 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5836 };
5837
5838 let call = transport
5839 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5840 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.lookupIndex"));
5841
5842 async move {
5843 let reply_env = call.await?;
5844
5845 let de = P::deserializer(reply_env);
5846 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::LookupIndexExn, _>, _) =
5847 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5848
5849 let res = match res {
5850 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5851 ::std::result::Result::Err(aexn) =>
5852 ::std::result::Result::Err(crate::errors::graph_storage_service::LookupIndexError::ApplicationException(aexn))
5853 };
5854 res
5855 }
5856 .instrument(::tracing::info_span!("GraphStorageService.lookupIndex"))
5857 .boxed()
5858 }
5859
5860 fn _lookupAndTraverse_impl(
5861 &self,
5862 arg_req: &crate::types::LookupAndTraverseRequest,
5863 rpc_options: T::RpcOptions,
5864 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>> {
5865 use ::const_cstr::const_cstr;
5866 use ::tracing::Instrument as _;
5867 use ::futures::FutureExt as _;
5868
5869 const_cstr! {
5870 SERVICE_NAME = "GraphStorageService";
5871 METHOD_NAME = "GraphStorageService.lookupAndTraverse";
5872 }
5873 let args = self::Args_GraphStorageService_lookupAndTraverse {
5874 req: arg_req,
5875 _phantom: ::std::marker::PhantomData,
5876 };
5877
5878 let transport = self.transport();
5879
5880 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("lookupAndTraverse", &args) {
5882 ::std::result::Result::Ok(res) => res,
5883 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5884 };
5885
5886 let call = transport
5887 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5888 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.lookupAndTraverse"));
5889
5890 async move {
5891 let reply_env = call.await?;
5892
5893 let de = P::deserializer(reply_env);
5894 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::LookupAndTraverseExn, _>, _) =
5895 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5896
5897 let res = match res {
5898 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5899 ::std::result::Result::Err(aexn) =>
5900 ::std::result::Result::Err(crate::errors::graph_storage_service::LookupAndTraverseError::ApplicationException(aexn))
5901 };
5902 res
5903 }
5904 .instrument(::tracing::info_span!("GraphStorageService.lookupAndTraverse"))
5905 .boxed()
5906 }
5907
5908 fn _chainUpdateEdge_impl(
5909 &self,
5910 arg_req: &crate::types::UpdateEdgeRequest,
5911 rpc_options: T::RpcOptions,
5912 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>> {
5913 use ::const_cstr::const_cstr;
5914 use ::tracing::Instrument as _;
5915 use ::futures::FutureExt as _;
5916
5917 const_cstr! {
5918 SERVICE_NAME = "GraphStorageService";
5919 METHOD_NAME = "GraphStorageService.chainUpdateEdge";
5920 }
5921 let args = self::Args_GraphStorageService_chainUpdateEdge {
5922 req: arg_req,
5923 _phantom: ::std::marker::PhantomData,
5924 };
5925
5926 let transport = self.transport();
5927
5928 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("chainUpdateEdge", &args) {
5930 ::std::result::Result::Ok(res) => res,
5931 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5932 };
5933
5934 let call = transport
5935 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5936 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.chainUpdateEdge"));
5937
5938 async move {
5939 let reply_env = call.await?;
5940
5941 let de = P::deserializer(reply_env);
5942 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::ChainUpdateEdgeExn, _>, _) =
5943 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5944
5945 let res = match res {
5946 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5947 ::std::result::Result::Err(aexn) =>
5948 ::std::result::Result::Err(crate::errors::graph_storage_service::ChainUpdateEdgeError::ApplicationException(aexn))
5949 };
5950 res
5951 }
5952 .instrument(::tracing::info_span!("GraphStorageService.chainUpdateEdge"))
5953 .boxed()
5954 }
5955
5956 fn _chainAddEdges_impl(
5957 &self,
5958 arg_req: &crate::types::AddEdgesRequest,
5959 rpc_options: T::RpcOptions,
5960 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>> {
5961 use ::const_cstr::const_cstr;
5962 use ::tracing::Instrument as _;
5963 use ::futures::FutureExt as _;
5964
5965 const_cstr! {
5966 SERVICE_NAME = "GraphStorageService";
5967 METHOD_NAME = "GraphStorageService.chainAddEdges";
5968 }
5969 let args = self::Args_GraphStorageService_chainAddEdges {
5970 req: arg_req,
5971 _phantom: ::std::marker::PhantomData,
5972 };
5973
5974 let transport = self.transport();
5975
5976 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("chainAddEdges", &args) {
5978 ::std::result::Result::Ok(res) => res,
5979 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
5980 };
5981
5982 let call = transport
5983 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
5984 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.chainAddEdges"));
5985
5986 async move {
5987 let reply_env = call.await?;
5988
5989 let de = P::deserializer(reply_env);
5990 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::ChainAddEdgesExn, _>, _) =
5991 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
5992
5993 let res = match res {
5994 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
5995 ::std::result::Result::Err(aexn) =>
5996 ::std::result::Result::Err(crate::errors::graph_storage_service::ChainAddEdgesError::ApplicationException(aexn))
5997 };
5998 res
5999 }
6000 .instrument(::tracing::info_span!("GraphStorageService.chainAddEdges"))
6001 .boxed()
6002 }
6003
6004 fn _chainDeleteEdges_impl(
6005 &self,
6006 arg_req: &crate::types::DeleteEdgesRequest,
6007 rpc_options: T::RpcOptions,
6008 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>> {
6009 use ::const_cstr::const_cstr;
6010 use ::tracing::Instrument as _;
6011 use ::futures::FutureExt as _;
6012
6013 const_cstr! {
6014 SERVICE_NAME = "GraphStorageService";
6015 METHOD_NAME = "GraphStorageService.chainDeleteEdges";
6016 }
6017 let args = self::Args_GraphStorageService_chainDeleteEdges {
6018 req: arg_req,
6019 _phantom: ::std::marker::PhantomData,
6020 };
6021
6022 let transport = self.transport();
6023
6024 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("chainDeleteEdges", &args) {
6026 ::std::result::Result::Ok(res) => res,
6027 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
6028 };
6029
6030 let call = transport
6031 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
6032 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.chainDeleteEdges"));
6033
6034 async move {
6035 let reply_env = call.await?;
6036
6037 let de = P::deserializer(reply_env);
6038 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::ChainDeleteEdgesExn, _>, _) =
6039 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
6040
6041 let res = match res {
6042 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
6043 ::std::result::Result::Err(aexn) =>
6044 ::std::result::Result::Err(crate::errors::graph_storage_service::ChainDeleteEdgesError::ApplicationException(aexn))
6045 };
6046 res
6047 }
6048 .instrument(::tracing::info_span!("GraphStorageService.chainDeleteEdges"))
6049 .boxed()
6050 }
6051
6052 fn _get_impl(
6053 &self,
6054 arg_req: &crate::types::KVGetRequest,
6055 rpc_options: T::RpcOptions,
6056 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>> {
6057 use ::const_cstr::const_cstr;
6058 use ::tracing::Instrument as _;
6059 use ::futures::FutureExt as _;
6060
6061 const_cstr! {
6062 SERVICE_NAME = "GraphStorageService";
6063 METHOD_NAME = "GraphStorageService.get";
6064 }
6065 let args = self::Args_GraphStorageService_get {
6066 req: arg_req,
6067 _phantom: ::std::marker::PhantomData,
6068 };
6069
6070 let transport = self.transport();
6071
6072 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("get", &args) {
6074 ::std::result::Result::Ok(res) => res,
6075 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
6076 };
6077
6078 let call = transport
6079 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
6080 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.get"));
6081
6082 async move {
6083 let reply_env = call.await?;
6084
6085 let de = P::deserializer(reply_env);
6086 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::GetExn, _>, _) =
6087 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
6088
6089 let res = match res {
6090 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
6091 ::std::result::Result::Err(aexn) =>
6092 ::std::result::Result::Err(crate::errors::graph_storage_service::GetError::ApplicationException(aexn))
6093 };
6094 res
6095 }
6096 .instrument(::tracing::info_span!("GraphStorageService.get"))
6097 .boxed()
6098 }
6099
6100 fn _put_impl(
6101 &self,
6102 arg_req: &crate::types::KVPutRequest,
6103 rpc_options: T::RpcOptions,
6104 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>> {
6105 use ::const_cstr::const_cstr;
6106 use ::tracing::Instrument as _;
6107 use ::futures::FutureExt as _;
6108
6109 const_cstr! {
6110 SERVICE_NAME = "GraphStorageService";
6111 METHOD_NAME = "GraphStorageService.put";
6112 }
6113 let args = self::Args_GraphStorageService_put {
6114 req: arg_req,
6115 _phantom: ::std::marker::PhantomData,
6116 };
6117
6118 let transport = self.transport();
6119
6120 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("put", &args) {
6122 ::std::result::Result::Ok(res) => res,
6123 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
6124 };
6125
6126 let call = transport
6127 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
6128 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.put"));
6129
6130 async move {
6131 let reply_env = call.await?;
6132
6133 let de = P::deserializer(reply_env);
6134 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::PutExn, _>, _) =
6135 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
6136
6137 let res = match res {
6138 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
6139 ::std::result::Result::Err(aexn) =>
6140 ::std::result::Result::Err(crate::errors::graph_storage_service::PutError::ApplicationException(aexn))
6141 };
6142 res
6143 }
6144 .instrument(::tracing::info_span!("GraphStorageService.put"))
6145 .boxed()
6146 }
6147
6148 fn _remove_impl(
6149 &self,
6150 arg_req: &crate::types::KVRemoveRequest,
6151 rpc_options: T::RpcOptions,
6152 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>> {
6153 use ::const_cstr::const_cstr;
6154 use ::tracing::Instrument as _;
6155 use ::futures::FutureExt as _;
6156
6157 const_cstr! {
6158 SERVICE_NAME = "GraphStorageService";
6159 METHOD_NAME = "GraphStorageService.remove";
6160 }
6161 let args = self::Args_GraphStorageService_remove {
6162 req: arg_req,
6163 _phantom: ::std::marker::PhantomData,
6164 };
6165
6166 let transport = self.transport();
6167
6168 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("remove", &args) {
6170 ::std::result::Result::Ok(res) => res,
6171 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
6172 };
6173
6174 let call = transport
6175 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
6176 .instrument(::tracing::trace_span!("call", function = "GraphStorageService.remove"));
6177
6178 async move {
6179 let reply_env = call.await?;
6180
6181 let de = P::deserializer(reply_env);
6182 let (res, _de): (::std::result::Result<crate::services::graph_storage_service::RemoveExn, _>, _) =
6183 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
6184
6185 let res = match res {
6186 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
6187 ::std::result::Result::Err(aexn) =>
6188 ::std::result::Result::Err(crate::errors::graph_storage_service::RemoveError::ApplicationException(aexn))
6189 };
6190 res
6191 }
6192 .instrument(::tracing::info_span!("GraphStorageService.remove"))
6193 .boxed()
6194 }
6195 }
6196
6197 pub trait GraphStorageService: ::std::marker::Send {
6198 fn getNeighbors(
6199 &self,
6200 arg_req: &crate::types::GetNeighborsRequest,
6201 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>>;
6202
6203 fn getDstBySrc(
6204 &self,
6205 arg_req: &crate::types::GetDstBySrcRequest,
6206 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>>;
6207
6208 fn getProps(
6209 &self,
6210 arg_req: &crate::types::GetPropRequest,
6211 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>>;
6212
6213 fn addVertices(
6214 &self,
6215 arg_req: &crate::types::AddVerticesRequest,
6216 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>>;
6217
6218 fn addEdges(
6219 &self,
6220 arg_req: &crate::types::AddEdgesRequest,
6221 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>>;
6222
6223 fn deleteEdges(
6224 &self,
6225 arg_req: &crate::types::DeleteEdgesRequest,
6226 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>>;
6227
6228 fn deleteVertices(
6229 &self,
6230 arg_req: &crate::types::DeleteVerticesRequest,
6231 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>>;
6232
6233 fn deleteTags(
6234 &self,
6235 arg_req: &crate::types::DeleteTagsRequest,
6236 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>>;
6237
6238 fn updateVertex(
6239 &self,
6240 arg_req: &crate::types::UpdateVertexRequest,
6241 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>>;
6242
6243 fn updateEdge(
6244 &self,
6245 arg_req: &crate::types::UpdateEdgeRequest,
6246 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>>;
6247
6248 fn scanVertex(
6249 &self,
6250 arg_req: &crate::types::ScanVertexRequest,
6251 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>>;
6252
6253 fn scanEdge(
6254 &self,
6255 arg_req: &crate::types::ScanEdgeRequest,
6256 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>>;
6257
6258 fn getUUID(
6259 &self,
6260 arg_req: &crate::types::GetUUIDReq,
6261 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>>;
6262
6263 fn lookupIndex(
6264 &self,
6265 arg_req: &crate::types::LookupIndexRequest,
6266 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>>;
6267
6268 fn lookupAndTraverse(
6269 &self,
6270 arg_req: &crate::types::LookupAndTraverseRequest,
6271 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>>;
6272
6273 fn chainUpdateEdge(
6274 &self,
6275 arg_req: &crate::types::UpdateEdgeRequest,
6276 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>>;
6277
6278 fn chainAddEdges(
6279 &self,
6280 arg_req: &crate::types::AddEdgesRequest,
6281 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>>;
6282
6283 fn chainDeleteEdges(
6284 &self,
6285 arg_req: &crate::types::DeleteEdgesRequest,
6286 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>>;
6287
6288 fn get(
6289 &self,
6290 arg_req: &crate::types::KVGetRequest,
6291 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>>;
6292
6293 fn put(
6294 &self,
6295 arg_req: &crate::types::KVPutRequest,
6296 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>>;
6297
6298 fn remove(
6299 &self,
6300 arg_req: &crate::types::KVRemoveRequest,
6301 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>>;
6302 }
6303
6304 pub trait GraphStorageServiceExt<T>: GraphStorageService
6305 where
6306 T: ::fbthrift::Transport,
6307 {
6308 fn getNeighbors_with_rpc_opts(
6309 &self,
6310 arg_req: &crate::types::GetNeighborsRequest,
6311 rpc_options: T::RpcOptions,
6312 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>>;
6313 fn getDstBySrc_with_rpc_opts(
6314 &self,
6315 arg_req: &crate::types::GetDstBySrcRequest,
6316 rpc_options: T::RpcOptions,
6317 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>>;
6318 fn getProps_with_rpc_opts(
6319 &self,
6320 arg_req: &crate::types::GetPropRequest,
6321 rpc_options: T::RpcOptions,
6322 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>>;
6323 fn addVertices_with_rpc_opts(
6324 &self,
6325 arg_req: &crate::types::AddVerticesRequest,
6326 rpc_options: T::RpcOptions,
6327 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>>;
6328 fn addEdges_with_rpc_opts(
6329 &self,
6330 arg_req: &crate::types::AddEdgesRequest,
6331 rpc_options: T::RpcOptions,
6332 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>>;
6333 fn deleteEdges_with_rpc_opts(
6334 &self,
6335 arg_req: &crate::types::DeleteEdgesRequest,
6336 rpc_options: T::RpcOptions,
6337 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>>;
6338 fn deleteVertices_with_rpc_opts(
6339 &self,
6340 arg_req: &crate::types::DeleteVerticesRequest,
6341 rpc_options: T::RpcOptions,
6342 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>>;
6343 fn deleteTags_with_rpc_opts(
6344 &self,
6345 arg_req: &crate::types::DeleteTagsRequest,
6346 rpc_options: T::RpcOptions,
6347 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>>;
6348 fn updateVertex_with_rpc_opts(
6349 &self,
6350 arg_req: &crate::types::UpdateVertexRequest,
6351 rpc_options: T::RpcOptions,
6352 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>>;
6353 fn updateEdge_with_rpc_opts(
6354 &self,
6355 arg_req: &crate::types::UpdateEdgeRequest,
6356 rpc_options: T::RpcOptions,
6357 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>>;
6358 fn scanVertex_with_rpc_opts(
6359 &self,
6360 arg_req: &crate::types::ScanVertexRequest,
6361 rpc_options: T::RpcOptions,
6362 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>>;
6363 fn scanEdge_with_rpc_opts(
6364 &self,
6365 arg_req: &crate::types::ScanEdgeRequest,
6366 rpc_options: T::RpcOptions,
6367 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>>;
6368 fn getUUID_with_rpc_opts(
6369 &self,
6370 arg_req: &crate::types::GetUUIDReq,
6371 rpc_options: T::RpcOptions,
6372 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>>;
6373 fn lookupIndex_with_rpc_opts(
6374 &self,
6375 arg_req: &crate::types::LookupIndexRequest,
6376 rpc_options: T::RpcOptions,
6377 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>>;
6378 fn lookupAndTraverse_with_rpc_opts(
6379 &self,
6380 arg_req: &crate::types::LookupAndTraverseRequest,
6381 rpc_options: T::RpcOptions,
6382 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>>;
6383 fn chainUpdateEdge_with_rpc_opts(
6384 &self,
6385 arg_req: &crate::types::UpdateEdgeRequest,
6386 rpc_options: T::RpcOptions,
6387 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>>;
6388 fn chainAddEdges_with_rpc_opts(
6389 &self,
6390 arg_req: &crate::types::AddEdgesRequest,
6391 rpc_options: T::RpcOptions,
6392 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>>;
6393 fn chainDeleteEdges_with_rpc_opts(
6394 &self,
6395 arg_req: &crate::types::DeleteEdgesRequest,
6396 rpc_options: T::RpcOptions,
6397 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>>;
6398 fn get_with_rpc_opts(
6399 &self,
6400 arg_req: &crate::types::KVGetRequest,
6401 rpc_options: T::RpcOptions,
6402 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>>;
6403 fn put_with_rpc_opts(
6404 &self,
6405 arg_req: &crate::types::KVPutRequest,
6406 rpc_options: T::RpcOptions,
6407 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>>;
6408 fn remove_with_rpc_opts(
6409 &self,
6410 arg_req: &crate::types::KVRemoveRequest,
6411 rpc_options: T::RpcOptions,
6412 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>>;
6413 }
6414
6415 struct Args_GraphStorageService_getNeighbors<'a> {
6416 req: &'a crate::types::GetNeighborsRequest,
6417 _phantom: ::std::marker::PhantomData<&'a ()>,
6418 }
6419
6420 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_getNeighbors<'a> {
6421 #[inline]
6422 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.getNeighbors"))]
6423 fn write(&self, p: &mut P) {
6424 p.write_struct_begin("args");
6425 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6426 ::fbthrift::Serialize::write(&self.req, p);
6427 p.write_field_end();
6428 p.write_field_stop();
6429 p.write_struct_end();
6430 }
6431 }
6432
6433 struct Args_GraphStorageService_getDstBySrc<'a> {
6434 req: &'a crate::types::GetDstBySrcRequest,
6435 _phantom: ::std::marker::PhantomData<&'a ()>,
6436 }
6437
6438 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_getDstBySrc<'a> {
6439 #[inline]
6440 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.getDstBySrc"))]
6441 fn write(&self, p: &mut P) {
6442 p.write_struct_begin("args");
6443 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6444 ::fbthrift::Serialize::write(&self.req, p);
6445 p.write_field_end();
6446 p.write_field_stop();
6447 p.write_struct_end();
6448 }
6449 }
6450
6451 struct Args_GraphStorageService_getProps<'a> {
6452 req: &'a crate::types::GetPropRequest,
6453 _phantom: ::std::marker::PhantomData<&'a ()>,
6454 }
6455
6456 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_getProps<'a> {
6457 #[inline]
6458 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.getProps"))]
6459 fn write(&self, p: &mut P) {
6460 p.write_struct_begin("args");
6461 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6462 ::fbthrift::Serialize::write(&self.req, p);
6463 p.write_field_end();
6464 p.write_field_stop();
6465 p.write_struct_end();
6466 }
6467 }
6468
6469 struct Args_GraphStorageService_addVertices<'a> {
6470 req: &'a crate::types::AddVerticesRequest,
6471 _phantom: ::std::marker::PhantomData<&'a ()>,
6472 }
6473
6474 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_addVertices<'a> {
6475 #[inline]
6476 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.addVertices"))]
6477 fn write(&self, p: &mut P) {
6478 p.write_struct_begin("args");
6479 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6480 ::fbthrift::Serialize::write(&self.req, p);
6481 p.write_field_end();
6482 p.write_field_stop();
6483 p.write_struct_end();
6484 }
6485 }
6486
6487 struct Args_GraphStorageService_addEdges<'a> {
6488 req: &'a crate::types::AddEdgesRequest,
6489 _phantom: ::std::marker::PhantomData<&'a ()>,
6490 }
6491
6492 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_addEdges<'a> {
6493 #[inline]
6494 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.addEdges"))]
6495 fn write(&self, p: &mut P) {
6496 p.write_struct_begin("args");
6497 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6498 ::fbthrift::Serialize::write(&self.req, p);
6499 p.write_field_end();
6500 p.write_field_stop();
6501 p.write_struct_end();
6502 }
6503 }
6504
6505 struct Args_GraphStorageService_deleteEdges<'a> {
6506 req: &'a crate::types::DeleteEdgesRequest,
6507 _phantom: ::std::marker::PhantomData<&'a ()>,
6508 }
6509
6510 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_deleteEdges<'a> {
6511 #[inline]
6512 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.deleteEdges"))]
6513 fn write(&self, p: &mut P) {
6514 p.write_struct_begin("args");
6515 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6516 ::fbthrift::Serialize::write(&self.req, p);
6517 p.write_field_end();
6518 p.write_field_stop();
6519 p.write_struct_end();
6520 }
6521 }
6522
6523 struct Args_GraphStorageService_deleteVertices<'a> {
6524 req: &'a crate::types::DeleteVerticesRequest,
6525 _phantom: ::std::marker::PhantomData<&'a ()>,
6526 }
6527
6528 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_deleteVertices<'a> {
6529 #[inline]
6530 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.deleteVertices"))]
6531 fn write(&self, p: &mut P) {
6532 p.write_struct_begin("args");
6533 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6534 ::fbthrift::Serialize::write(&self.req, p);
6535 p.write_field_end();
6536 p.write_field_stop();
6537 p.write_struct_end();
6538 }
6539 }
6540
6541 struct Args_GraphStorageService_deleteTags<'a> {
6542 req: &'a crate::types::DeleteTagsRequest,
6543 _phantom: ::std::marker::PhantomData<&'a ()>,
6544 }
6545
6546 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_deleteTags<'a> {
6547 #[inline]
6548 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.deleteTags"))]
6549 fn write(&self, p: &mut P) {
6550 p.write_struct_begin("args");
6551 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6552 ::fbthrift::Serialize::write(&self.req, p);
6553 p.write_field_end();
6554 p.write_field_stop();
6555 p.write_struct_end();
6556 }
6557 }
6558
6559 struct Args_GraphStorageService_updateVertex<'a> {
6560 req: &'a crate::types::UpdateVertexRequest,
6561 _phantom: ::std::marker::PhantomData<&'a ()>,
6562 }
6563
6564 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_updateVertex<'a> {
6565 #[inline]
6566 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.updateVertex"))]
6567 fn write(&self, p: &mut P) {
6568 p.write_struct_begin("args");
6569 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6570 ::fbthrift::Serialize::write(&self.req, p);
6571 p.write_field_end();
6572 p.write_field_stop();
6573 p.write_struct_end();
6574 }
6575 }
6576
6577 struct Args_GraphStorageService_updateEdge<'a> {
6578 req: &'a crate::types::UpdateEdgeRequest,
6579 _phantom: ::std::marker::PhantomData<&'a ()>,
6580 }
6581
6582 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_updateEdge<'a> {
6583 #[inline]
6584 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.updateEdge"))]
6585 fn write(&self, p: &mut P) {
6586 p.write_struct_begin("args");
6587 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6588 ::fbthrift::Serialize::write(&self.req, p);
6589 p.write_field_end();
6590 p.write_field_stop();
6591 p.write_struct_end();
6592 }
6593 }
6594
6595 struct Args_GraphStorageService_scanVertex<'a> {
6596 req: &'a crate::types::ScanVertexRequest,
6597 _phantom: ::std::marker::PhantomData<&'a ()>,
6598 }
6599
6600 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_scanVertex<'a> {
6601 #[inline]
6602 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.scanVertex"))]
6603 fn write(&self, p: &mut P) {
6604 p.write_struct_begin("args");
6605 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6606 ::fbthrift::Serialize::write(&self.req, p);
6607 p.write_field_end();
6608 p.write_field_stop();
6609 p.write_struct_end();
6610 }
6611 }
6612
6613 struct Args_GraphStorageService_scanEdge<'a> {
6614 req: &'a crate::types::ScanEdgeRequest,
6615 _phantom: ::std::marker::PhantomData<&'a ()>,
6616 }
6617
6618 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_scanEdge<'a> {
6619 #[inline]
6620 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.scanEdge"))]
6621 fn write(&self, p: &mut P) {
6622 p.write_struct_begin("args");
6623 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6624 ::fbthrift::Serialize::write(&self.req, p);
6625 p.write_field_end();
6626 p.write_field_stop();
6627 p.write_struct_end();
6628 }
6629 }
6630
6631 struct Args_GraphStorageService_getUUID<'a> {
6632 req: &'a crate::types::GetUUIDReq,
6633 _phantom: ::std::marker::PhantomData<&'a ()>,
6634 }
6635
6636 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_getUUID<'a> {
6637 #[inline]
6638 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.getUUID"))]
6639 fn write(&self, p: &mut P) {
6640 p.write_struct_begin("args");
6641 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6642 ::fbthrift::Serialize::write(&self.req, p);
6643 p.write_field_end();
6644 p.write_field_stop();
6645 p.write_struct_end();
6646 }
6647 }
6648
6649 struct Args_GraphStorageService_lookupIndex<'a> {
6650 req: &'a crate::types::LookupIndexRequest,
6651 _phantom: ::std::marker::PhantomData<&'a ()>,
6652 }
6653
6654 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_lookupIndex<'a> {
6655 #[inline]
6656 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.lookupIndex"))]
6657 fn write(&self, p: &mut P) {
6658 p.write_struct_begin("args");
6659 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6660 ::fbthrift::Serialize::write(&self.req, p);
6661 p.write_field_end();
6662 p.write_field_stop();
6663 p.write_struct_end();
6664 }
6665 }
6666
6667 struct Args_GraphStorageService_lookupAndTraverse<'a> {
6668 req: &'a crate::types::LookupAndTraverseRequest,
6669 _phantom: ::std::marker::PhantomData<&'a ()>,
6670 }
6671
6672 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_lookupAndTraverse<'a> {
6673 #[inline]
6674 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.lookupAndTraverse"))]
6675 fn write(&self, p: &mut P) {
6676 p.write_struct_begin("args");
6677 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6678 ::fbthrift::Serialize::write(&self.req, p);
6679 p.write_field_end();
6680 p.write_field_stop();
6681 p.write_struct_end();
6682 }
6683 }
6684
6685 struct Args_GraphStorageService_chainUpdateEdge<'a> {
6686 req: &'a crate::types::UpdateEdgeRequest,
6687 _phantom: ::std::marker::PhantomData<&'a ()>,
6688 }
6689
6690 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_chainUpdateEdge<'a> {
6691 #[inline]
6692 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.chainUpdateEdge"))]
6693 fn write(&self, p: &mut P) {
6694 p.write_struct_begin("args");
6695 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6696 ::fbthrift::Serialize::write(&self.req, p);
6697 p.write_field_end();
6698 p.write_field_stop();
6699 p.write_struct_end();
6700 }
6701 }
6702
6703 struct Args_GraphStorageService_chainAddEdges<'a> {
6704 req: &'a crate::types::AddEdgesRequest,
6705 _phantom: ::std::marker::PhantomData<&'a ()>,
6706 }
6707
6708 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_chainAddEdges<'a> {
6709 #[inline]
6710 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.chainAddEdges"))]
6711 fn write(&self, p: &mut P) {
6712 p.write_struct_begin("args");
6713 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6714 ::fbthrift::Serialize::write(&self.req, p);
6715 p.write_field_end();
6716 p.write_field_stop();
6717 p.write_struct_end();
6718 }
6719 }
6720
6721 struct Args_GraphStorageService_chainDeleteEdges<'a> {
6722 req: &'a crate::types::DeleteEdgesRequest,
6723 _phantom: ::std::marker::PhantomData<&'a ()>,
6724 }
6725
6726 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_chainDeleteEdges<'a> {
6727 #[inline]
6728 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.chainDeleteEdges"))]
6729 fn write(&self, p: &mut P) {
6730 p.write_struct_begin("args");
6731 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6732 ::fbthrift::Serialize::write(&self.req, p);
6733 p.write_field_end();
6734 p.write_field_stop();
6735 p.write_struct_end();
6736 }
6737 }
6738
6739 struct Args_GraphStorageService_get<'a> {
6740 req: &'a crate::types::KVGetRequest,
6741 _phantom: ::std::marker::PhantomData<&'a ()>,
6742 }
6743
6744 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_get<'a> {
6745 #[inline]
6746 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.get"))]
6747 fn write(&self, p: &mut P) {
6748 p.write_struct_begin("args");
6749 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6750 ::fbthrift::Serialize::write(&self.req, p);
6751 p.write_field_end();
6752 p.write_field_stop();
6753 p.write_struct_end();
6754 }
6755 }
6756
6757 struct Args_GraphStorageService_put<'a> {
6758 req: &'a crate::types::KVPutRequest,
6759 _phantom: ::std::marker::PhantomData<&'a ()>,
6760 }
6761
6762 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_put<'a> {
6763 #[inline]
6764 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.put"))]
6765 fn write(&self, p: &mut P) {
6766 p.write_struct_begin("args");
6767 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6768 ::fbthrift::Serialize::write(&self.req, p);
6769 p.write_field_end();
6770 p.write_field_stop();
6771 p.write_struct_end();
6772 }
6773 }
6774
6775 struct Args_GraphStorageService_remove<'a> {
6776 req: &'a crate::types::KVRemoveRequest,
6777 _phantom: ::std::marker::PhantomData<&'a ()>,
6778 }
6779
6780 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_GraphStorageService_remove<'a> {
6781 #[inline]
6782 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "GraphStorageService.remove"))]
6783 fn write(&self, p: &mut P) {
6784 p.write_struct_begin("args");
6785 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
6786 ::fbthrift::Serialize::write(&self.req, p);
6787 p.write_field_end();
6788 p.write_field_stop();
6789 p.write_struct_end();
6790 }
6791 }
6792
6793 impl<P, T, S> GraphStorageService for GraphStorageServiceImpl<P, T, S>
6794 where
6795 P: ::fbthrift::Protocol,
6796 T: ::fbthrift::Transport,
6797 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
6798 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
6799 P::Deserializer: ::std::marker::Send,
6800 S: ::fbthrift::help::Spawner,
6801 {
6802 fn getNeighbors(
6803 &self,
6804 arg_req: &crate::types::GetNeighborsRequest,
6805 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>> {
6806 let rpc_options = T::RpcOptions::default();
6807 self._getNeighbors_impl(
6808 arg_req,
6809 rpc_options,
6810 )
6811 }
6812 fn getDstBySrc(
6813 &self,
6814 arg_req: &crate::types::GetDstBySrcRequest,
6815 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>> {
6816 let rpc_options = T::RpcOptions::default();
6817 self._getDstBySrc_impl(
6818 arg_req,
6819 rpc_options,
6820 )
6821 }
6822 fn getProps(
6823 &self,
6824 arg_req: &crate::types::GetPropRequest,
6825 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>> {
6826 let rpc_options = T::RpcOptions::default();
6827 self._getProps_impl(
6828 arg_req,
6829 rpc_options,
6830 )
6831 }
6832 fn addVertices(
6833 &self,
6834 arg_req: &crate::types::AddVerticesRequest,
6835 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>> {
6836 let rpc_options = T::RpcOptions::default();
6837 self._addVertices_impl(
6838 arg_req,
6839 rpc_options,
6840 )
6841 }
6842 fn addEdges(
6843 &self,
6844 arg_req: &crate::types::AddEdgesRequest,
6845 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>> {
6846 let rpc_options = T::RpcOptions::default();
6847 self._addEdges_impl(
6848 arg_req,
6849 rpc_options,
6850 )
6851 }
6852 fn deleteEdges(
6853 &self,
6854 arg_req: &crate::types::DeleteEdgesRequest,
6855 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>> {
6856 let rpc_options = T::RpcOptions::default();
6857 self._deleteEdges_impl(
6858 arg_req,
6859 rpc_options,
6860 )
6861 }
6862 fn deleteVertices(
6863 &self,
6864 arg_req: &crate::types::DeleteVerticesRequest,
6865 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>> {
6866 let rpc_options = T::RpcOptions::default();
6867 self._deleteVertices_impl(
6868 arg_req,
6869 rpc_options,
6870 )
6871 }
6872 fn deleteTags(
6873 &self,
6874 arg_req: &crate::types::DeleteTagsRequest,
6875 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>> {
6876 let rpc_options = T::RpcOptions::default();
6877 self._deleteTags_impl(
6878 arg_req,
6879 rpc_options,
6880 )
6881 }
6882 fn updateVertex(
6883 &self,
6884 arg_req: &crate::types::UpdateVertexRequest,
6885 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>> {
6886 let rpc_options = T::RpcOptions::default();
6887 self._updateVertex_impl(
6888 arg_req,
6889 rpc_options,
6890 )
6891 }
6892 fn updateEdge(
6893 &self,
6894 arg_req: &crate::types::UpdateEdgeRequest,
6895 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>> {
6896 let rpc_options = T::RpcOptions::default();
6897 self._updateEdge_impl(
6898 arg_req,
6899 rpc_options,
6900 )
6901 }
6902 fn scanVertex(
6903 &self,
6904 arg_req: &crate::types::ScanVertexRequest,
6905 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>> {
6906 let rpc_options = T::RpcOptions::default();
6907 self._scanVertex_impl(
6908 arg_req,
6909 rpc_options,
6910 )
6911 }
6912 fn scanEdge(
6913 &self,
6914 arg_req: &crate::types::ScanEdgeRequest,
6915 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>> {
6916 let rpc_options = T::RpcOptions::default();
6917 self._scanEdge_impl(
6918 arg_req,
6919 rpc_options,
6920 )
6921 }
6922 fn getUUID(
6923 &self,
6924 arg_req: &crate::types::GetUUIDReq,
6925 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>> {
6926 let rpc_options = T::RpcOptions::default();
6927 self._getUUID_impl(
6928 arg_req,
6929 rpc_options,
6930 )
6931 }
6932 fn lookupIndex(
6933 &self,
6934 arg_req: &crate::types::LookupIndexRequest,
6935 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>> {
6936 let rpc_options = T::RpcOptions::default();
6937 self._lookupIndex_impl(
6938 arg_req,
6939 rpc_options,
6940 )
6941 }
6942 fn lookupAndTraverse(
6943 &self,
6944 arg_req: &crate::types::LookupAndTraverseRequest,
6945 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>> {
6946 let rpc_options = T::RpcOptions::default();
6947 self._lookupAndTraverse_impl(
6948 arg_req,
6949 rpc_options,
6950 )
6951 }
6952 fn chainUpdateEdge(
6953 &self,
6954 arg_req: &crate::types::UpdateEdgeRequest,
6955 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>> {
6956 let rpc_options = T::RpcOptions::default();
6957 self._chainUpdateEdge_impl(
6958 arg_req,
6959 rpc_options,
6960 )
6961 }
6962 fn chainAddEdges(
6963 &self,
6964 arg_req: &crate::types::AddEdgesRequest,
6965 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>> {
6966 let rpc_options = T::RpcOptions::default();
6967 self._chainAddEdges_impl(
6968 arg_req,
6969 rpc_options,
6970 )
6971 }
6972 fn chainDeleteEdges(
6973 &self,
6974 arg_req: &crate::types::DeleteEdgesRequest,
6975 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>> {
6976 let rpc_options = T::RpcOptions::default();
6977 self._chainDeleteEdges_impl(
6978 arg_req,
6979 rpc_options,
6980 )
6981 }
6982 fn get(
6983 &self,
6984 arg_req: &crate::types::KVGetRequest,
6985 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>> {
6986 let rpc_options = T::RpcOptions::default();
6987 self._get_impl(
6988 arg_req,
6989 rpc_options,
6990 )
6991 }
6992 fn put(
6993 &self,
6994 arg_req: &crate::types::KVPutRequest,
6995 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>> {
6996 let rpc_options = T::RpcOptions::default();
6997 self._put_impl(
6998 arg_req,
6999 rpc_options,
7000 )
7001 }
7002 fn remove(
7003 &self,
7004 arg_req: &crate::types::KVRemoveRequest,
7005 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>> {
7006 let rpc_options = T::RpcOptions::default();
7007 self._remove_impl(
7008 arg_req,
7009 rpc_options,
7010 )
7011 }
7012 }
7013
7014 impl<P, T, S> GraphStorageServiceExt<T> for GraphStorageServiceImpl<P, T, S>
7015 where
7016 P: ::fbthrift::Protocol,
7017 T: ::fbthrift::Transport,
7018 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
7019 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
7020 P::Deserializer: ::std::marker::Send,
7021 S: ::fbthrift::help::Spawner,
7022 {
7023 fn getNeighbors_with_rpc_opts(
7024 &self,
7025 arg_req: &crate::types::GetNeighborsRequest,
7026 rpc_options: T::RpcOptions,
7027 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>> {
7028 self._getNeighbors_impl(
7029 arg_req,
7030 rpc_options,
7031 )
7032 }
7033 fn getDstBySrc_with_rpc_opts(
7034 &self,
7035 arg_req: &crate::types::GetDstBySrcRequest,
7036 rpc_options: T::RpcOptions,
7037 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>> {
7038 self._getDstBySrc_impl(
7039 arg_req,
7040 rpc_options,
7041 )
7042 }
7043 fn getProps_with_rpc_opts(
7044 &self,
7045 arg_req: &crate::types::GetPropRequest,
7046 rpc_options: T::RpcOptions,
7047 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>> {
7048 self._getProps_impl(
7049 arg_req,
7050 rpc_options,
7051 )
7052 }
7053 fn addVertices_with_rpc_opts(
7054 &self,
7055 arg_req: &crate::types::AddVerticesRequest,
7056 rpc_options: T::RpcOptions,
7057 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>> {
7058 self._addVertices_impl(
7059 arg_req,
7060 rpc_options,
7061 )
7062 }
7063 fn addEdges_with_rpc_opts(
7064 &self,
7065 arg_req: &crate::types::AddEdgesRequest,
7066 rpc_options: T::RpcOptions,
7067 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>> {
7068 self._addEdges_impl(
7069 arg_req,
7070 rpc_options,
7071 )
7072 }
7073 fn deleteEdges_with_rpc_opts(
7074 &self,
7075 arg_req: &crate::types::DeleteEdgesRequest,
7076 rpc_options: T::RpcOptions,
7077 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>> {
7078 self._deleteEdges_impl(
7079 arg_req,
7080 rpc_options,
7081 )
7082 }
7083 fn deleteVertices_with_rpc_opts(
7084 &self,
7085 arg_req: &crate::types::DeleteVerticesRequest,
7086 rpc_options: T::RpcOptions,
7087 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>> {
7088 self._deleteVertices_impl(
7089 arg_req,
7090 rpc_options,
7091 )
7092 }
7093 fn deleteTags_with_rpc_opts(
7094 &self,
7095 arg_req: &crate::types::DeleteTagsRequest,
7096 rpc_options: T::RpcOptions,
7097 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>> {
7098 self._deleteTags_impl(
7099 arg_req,
7100 rpc_options,
7101 )
7102 }
7103 fn updateVertex_with_rpc_opts(
7104 &self,
7105 arg_req: &crate::types::UpdateVertexRequest,
7106 rpc_options: T::RpcOptions,
7107 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>> {
7108 self._updateVertex_impl(
7109 arg_req,
7110 rpc_options,
7111 )
7112 }
7113 fn updateEdge_with_rpc_opts(
7114 &self,
7115 arg_req: &crate::types::UpdateEdgeRequest,
7116 rpc_options: T::RpcOptions,
7117 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>> {
7118 self._updateEdge_impl(
7119 arg_req,
7120 rpc_options,
7121 )
7122 }
7123 fn scanVertex_with_rpc_opts(
7124 &self,
7125 arg_req: &crate::types::ScanVertexRequest,
7126 rpc_options: T::RpcOptions,
7127 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>> {
7128 self._scanVertex_impl(
7129 arg_req,
7130 rpc_options,
7131 )
7132 }
7133 fn scanEdge_with_rpc_opts(
7134 &self,
7135 arg_req: &crate::types::ScanEdgeRequest,
7136 rpc_options: T::RpcOptions,
7137 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>> {
7138 self._scanEdge_impl(
7139 arg_req,
7140 rpc_options,
7141 )
7142 }
7143 fn getUUID_with_rpc_opts(
7144 &self,
7145 arg_req: &crate::types::GetUUIDReq,
7146 rpc_options: T::RpcOptions,
7147 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>> {
7148 self._getUUID_impl(
7149 arg_req,
7150 rpc_options,
7151 )
7152 }
7153 fn lookupIndex_with_rpc_opts(
7154 &self,
7155 arg_req: &crate::types::LookupIndexRequest,
7156 rpc_options: T::RpcOptions,
7157 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>> {
7158 self._lookupIndex_impl(
7159 arg_req,
7160 rpc_options,
7161 )
7162 }
7163 fn lookupAndTraverse_with_rpc_opts(
7164 &self,
7165 arg_req: &crate::types::LookupAndTraverseRequest,
7166 rpc_options: T::RpcOptions,
7167 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>> {
7168 self._lookupAndTraverse_impl(
7169 arg_req,
7170 rpc_options,
7171 )
7172 }
7173 fn chainUpdateEdge_with_rpc_opts(
7174 &self,
7175 arg_req: &crate::types::UpdateEdgeRequest,
7176 rpc_options: T::RpcOptions,
7177 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>> {
7178 self._chainUpdateEdge_impl(
7179 arg_req,
7180 rpc_options,
7181 )
7182 }
7183 fn chainAddEdges_with_rpc_opts(
7184 &self,
7185 arg_req: &crate::types::AddEdgesRequest,
7186 rpc_options: T::RpcOptions,
7187 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>> {
7188 self._chainAddEdges_impl(
7189 arg_req,
7190 rpc_options,
7191 )
7192 }
7193 fn chainDeleteEdges_with_rpc_opts(
7194 &self,
7195 arg_req: &crate::types::DeleteEdgesRequest,
7196 rpc_options: T::RpcOptions,
7197 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>> {
7198 self._chainDeleteEdges_impl(
7199 arg_req,
7200 rpc_options,
7201 )
7202 }
7203 fn get_with_rpc_opts(
7204 &self,
7205 arg_req: &crate::types::KVGetRequest,
7206 rpc_options: T::RpcOptions,
7207 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>> {
7208 self._get_impl(
7209 arg_req,
7210 rpc_options,
7211 )
7212 }
7213 fn put_with_rpc_opts(
7214 &self,
7215 arg_req: &crate::types::KVPutRequest,
7216 rpc_options: T::RpcOptions,
7217 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>> {
7218 self._put_impl(
7219 arg_req,
7220 rpc_options,
7221 )
7222 }
7223 fn remove_with_rpc_opts(
7224 &self,
7225 arg_req: &crate::types::KVRemoveRequest,
7226 rpc_options: T::RpcOptions,
7227 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>> {
7228 self._remove_impl(
7229 arg_req,
7230 rpc_options,
7231 )
7232 }
7233 }
7234
7235 impl<'a, S> GraphStorageService for S
7236 where
7237 S: ::std::convert::AsRef<dyn GraphStorageService + 'a>,
7238 S: ::std::marker::Send,
7239 {
7240 fn getNeighbors(
7241 &self,
7242 arg_req: &crate::types::GetNeighborsRequest,
7243 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>> {
7244 self.as_ref().getNeighbors(
7245 arg_req,
7246 )
7247 }
7248 fn getDstBySrc(
7249 &self,
7250 arg_req: &crate::types::GetDstBySrcRequest,
7251 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>> {
7252 self.as_ref().getDstBySrc(
7253 arg_req,
7254 )
7255 }
7256 fn getProps(
7257 &self,
7258 arg_req: &crate::types::GetPropRequest,
7259 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>> {
7260 self.as_ref().getProps(
7261 arg_req,
7262 )
7263 }
7264 fn addVertices(
7265 &self,
7266 arg_req: &crate::types::AddVerticesRequest,
7267 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>> {
7268 self.as_ref().addVertices(
7269 arg_req,
7270 )
7271 }
7272 fn addEdges(
7273 &self,
7274 arg_req: &crate::types::AddEdgesRequest,
7275 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>> {
7276 self.as_ref().addEdges(
7277 arg_req,
7278 )
7279 }
7280 fn deleteEdges(
7281 &self,
7282 arg_req: &crate::types::DeleteEdgesRequest,
7283 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>> {
7284 self.as_ref().deleteEdges(
7285 arg_req,
7286 )
7287 }
7288 fn deleteVertices(
7289 &self,
7290 arg_req: &crate::types::DeleteVerticesRequest,
7291 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>> {
7292 self.as_ref().deleteVertices(
7293 arg_req,
7294 )
7295 }
7296 fn deleteTags(
7297 &self,
7298 arg_req: &crate::types::DeleteTagsRequest,
7299 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>> {
7300 self.as_ref().deleteTags(
7301 arg_req,
7302 )
7303 }
7304 fn updateVertex(
7305 &self,
7306 arg_req: &crate::types::UpdateVertexRequest,
7307 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>> {
7308 self.as_ref().updateVertex(
7309 arg_req,
7310 )
7311 }
7312 fn updateEdge(
7313 &self,
7314 arg_req: &crate::types::UpdateEdgeRequest,
7315 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>> {
7316 self.as_ref().updateEdge(
7317 arg_req,
7318 )
7319 }
7320 fn scanVertex(
7321 &self,
7322 arg_req: &crate::types::ScanVertexRequest,
7323 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>> {
7324 self.as_ref().scanVertex(
7325 arg_req,
7326 )
7327 }
7328 fn scanEdge(
7329 &self,
7330 arg_req: &crate::types::ScanEdgeRequest,
7331 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>> {
7332 self.as_ref().scanEdge(
7333 arg_req,
7334 )
7335 }
7336 fn getUUID(
7337 &self,
7338 arg_req: &crate::types::GetUUIDReq,
7339 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>> {
7340 self.as_ref().getUUID(
7341 arg_req,
7342 )
7343 }
7344 fn lookupIndex(
7345 &self,
7346 arg_req: &crate::types::LookupIndexRequest,
7347 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>> {
7348 self.as_ref().lookupIndex(
7349 arg_req,
7350 )
7351 }
7352 fn lookupAndTraverse(
7353 &self,
7354 arg_req: &crate::types::LookupAndTraverseRequest,
7355 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>> {
7356 self.as_ref().lookupAndTraverse(
7357 arg_req,
7358 )
7359 }
7360 fn chainUpdateEdge(
7361 &self,
7362 arg_req: &crate::types::UpdateEdgeRequest,
7363 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>> {
7364 self.as_ref().chainUpdateEdge(
7365 arg_req,
7366 )
7367 }
7368 fn chainAddEdges(
7369 &self,
7370 arg_req: &crate::types::AddEdgesRequest,
7371 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>> {
7372 self.as_ref().chainAddEdges(
7373 arg_req,
7374 )
7375 }
7376 fn chainDeleteEdges(
7377 &self,
7378 arg_req: &crate::types::DeleteEdgesRequest,
7379 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>> {
7380 self.as_ref().chainDeleteEdges(
7381 arg_req,
7382 )
7383 }
7384 fn get(
7385 &self,
7386 arg_req: &crate::types::KVGetRequest,
7387 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>> {
7388 self.as_ref().get(
7389 arg_req,
7390 )
7391 }
7392 fn put(
7393 &self,
7394 arg_req: &crate::types::KVPutRequest,
7395 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>> {
7396 self.as_ref().put(
7397 arg_req,
7398 )
7399 }
7400 fn remove(
7401 &self,
7402 arg_req: &crate::types::KVRemoveRequest,
7403 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>> {
7404 self.as_ref().remove(
7405 arg_req,
7406 )
7407 }
7408 }
7409
7410 impl<'a, S, T> GraphStorageServiceExt<T> for S
7411 where
7412 S: ::std::convert::AsRef<dyn GraphStorageService + 'a>,
7413 S: ::std::convert::AsRef<dyn GraphStorageServiceExt<T> + 'a>,
7414 S: ::std::marker::Send,
7415 T: ::fbthrift::Transport,
7416 {
7417 fn getNeighbors_with_rpc_opts(
7418 &self,
7419 arg_req: &crate::types::GetNeighborsRequest,
7420 rpc_options: T::RpcOptions,
7421 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>> {
7422 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).getNeighbors_with_rpc_opts(
7423 arg_req,
7424 rpc_options,
7425 )
7426 }
7427 fn getDstBySrc_with_rpc_opts(
7428 &self,
7429 arg_req: &crate::types::GetDstBySrcRequest,
7430 rpc_options: T::RpcOptions,
7431 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>> {
7432 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).getDstBySrc_with_rpc_opts(
7433 arg_req,
7434 rpc_options,
7435 )
7436 }
7437 fn getProps_with_rpc_opts(
7438 &self,
7439 arg_req: &crate::types::GetPropRequest,
7440 rpc_options: T::RpcOptions,
7441 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>> {
7442 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).getProps_with_rpc_opts(
7443 arg_req,
7444 rpc_options,
7445 )
7446 }
7447 fn addVertices_with_rpc_opts(
7448 &self,
7449 arg_req: &crate::types::AddVerticesRequest,
7450 rpc_options: T::RpcOptions,
7451 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>> {
7452 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).addVertices_with_rpc_opts(
7453 arg_req,
7454 rpc_options,
7455 )
7456 }
7457 fn addEdges_with_rpc_opts(
7458 &self,
7459 arg_req: &crate::types::AddEdgesRequest,
7460 rpc_options: T::RpcOptions,
7461 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>> {
7462 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).addEdges_with_rpc_opts(
7463 arg_req,
7464 rpc_options,
7465 )
7466 }
7467 fn deleteEdges_with_rpc_opts(
7468 &self,
7469 arg_req: &crate::types::DeleteEdgesRequest,
7470 rpc_options: T::RpcOptions,
7471 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>> {
7472 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).deleteEdges_with_rpc_opts(
7473 arg_req,
7474 rpc_options,
7475 )
7476 }
7477 fn deleteVertices_with_rpc_opts(
7478 &self,
7479 arg_req: &crate::types::DeleteVerticesRequest,
7480 rpc_options: T::RpcOptions,
7481 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>> {
7482 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).deleteVertices_with_rpc_opts(
7483 arg_req,
7484 rpc_options,
7485 )
7486 }
7487 fn deleteTags_with_rpc_opts(
7488 &self,
7489 arg_req: &crate::types::DeleteTagsRequest,
7490 rpc_options: T::RpcOptions,
7491 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>> {
7492 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).deleteTags_with_rpc_opts(
7493 arg_req,
7494 rpc_options,
7495 )
7496 }
7497 fn updateVertex_with_rpc_opts(
7498 &self,
7499 arg_req: &crate::types::UpdateVertexRequest,
7500 rpc_options: T::RpcOptions,
7501 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>> {
7502 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).updateVertex_with_rpc_opts(
7503 arg_req,
7504 rpc_options,
7505 )
7506 }
7507 fn updateEdge_with_rpc_opts(
7508 &self,
7509 arg_req: &crate::types::UpdateEdgeRequest,
7510 rpc_options: T::RpcOptions,
7511 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>> {
7512 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).updateEdge_with_rpc_opts(
7513 arg_req,
7514 rpc_options,
7515 )
7516 }
7517 fn scanVertex_with_rpc_opts(
7518 &self,
7519 arg_req: &crate::types::ScanVertexRequest,
7520 rpc_options: T::RpcOptions,
7521 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>> {
7522 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).scanVertex_with_rpc_opts(
7523 arg_req,
7524 rpc_options,
7525 )
7526 }
7527 fn scanEdge_with_rpc_opts(
7528 &self,
7529 arg_req: &crate::types::ScanEdgeRequest,
7530 rpc_options: T::RpcOptions,
7531 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>> {
7532 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).scanEdge_with_rpc_opts(
7533 arg_req,
7534 rpc_options,
7535 )
7536 }
7537 fn getUUID_with_rpc_opts(
7538 &self,
7539 arg_req: &crate::types::GetUUIDReq,
7540 rpc_options: T::RpcOptions,
7541 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>> {
7542 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).getUUID_with_rpc_opts(
7543 arg_req,
7544 rpc_options,
7545 )
7546 }
7547 fn lookupIndex_with_rpc_opts(
7548 &self,
7549 arg_req: &crate::types::LookupIndexRequest,
7550 rpc_options: T::RpcOptions,
7551 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>> {
7552 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).lookupIndex_with_rpc_opts(
7553 arg_req,
7554 rpc_options,
7555 )
7556 }
7557 fn lookupAndTraverse_with_rpc_opts(
7558 &self,
7559 arg_req: &crate::types::LookupAndTraverseRequest,
7560 rpc_options: T::RpcOptions,
7561 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>> {
7562 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).lookupAndTraverse_with_rpc_opts(
7563 arg_req,
7564 rpc_options,
7565 )
7566 }
7567 fn chainUpdateEdge_with_rpc_opts(
7568 &self,
7569 arg_req: &crate::types::UpdateEdgeRequest,
7570 rpc_options: T::RpcOptions,
7571 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>> {
7572 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).chainUpdateEdge_with_rpc_opts(
7573 arg_req,
7574 rpc_options,
7575 )
7576 }
7577 fn chainAddEdges_with_rpc_opts(
7578 &self,
7579 arg_req: &crate::types::AddEdgesRequest,
7580 rpc_options: T::RpcOptions,
7581 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>> {
7582 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).chainAddEdges_with_rpc_opts(
7583 arg_req,
7584 rpc_options,
7585 )
7586 }
7587 fn chainDeleteEdges_with_rpc_opts(
7588 &self,
7589 arg_req: &crate::types::DeleteEdgesRequest,
7590 rpc_options: T::RpcOptions,
7591 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>> {
7592 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).chainDeleteEdges_with_rpc_opts(
7593 arg_req,
7594 rpc_options,
7595 )
7596 }
7597 fn get_with_rpc_opts(
7598 &self,
7599 arg_req: &crate::types::KVGetRequest,
7600 rpc_options: T::RpcOptions,
7601 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>> {
7602 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).get_with_rpc_opts(
7603 arg_req,
7604 rpc_options,
7605 )
7606 }
7607 fn put_with_rpc_opts(
7608 &self,
7609 arg_req: &crate::types::KVPutRequest,
7610 rpc_options: T::RpcOptions,
7611 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>> {
7612 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).put_with_rpc_opts(
7613 arg_req,
7614 rpc_options,
7615 )
7616 }
7617 fn remove_with_rpc_opts(
7618 &self,
7619 arg_req: &crate::types::KVRemoveRequest,
7620 rpc_options: T::RpcOptions,
7621 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>> {
7622 <Self as ::std::convert::AsRef<dyn GraphStorageServiceExt<T>>>::as_ref(self).remove_with_rpc_opts(
7623 arg_req,
7624 rpc_options,
7625 )
7626 }
7627 }
7628
7629 #[derive(Clone)]
7630 pub struct make_GraphStorageService;
7631
7632 impl dyn GraphStorageService {
7646 pub fn new<P, T>(
7647 protocol: P,
7648 transport: T,
7649 ) -> ::std::sync::Arc<impl GraphStorageService + ::std::marker::Send + ::std::marker::Sync + 'static>
7650 where
7651 P: ::fbthrift::Protocol<Frame = T>,
7652 T: ::fbthrift::Transport,
7653 P::Deserializer: ::std::marker::Send,
7654 {
7655 let spawner = ::fbthrift::help::NoopSpawner;
7656 Self::with_spawner(protocol, transport, spawner)
7657 }
7658
7659 pub fn with_spawner<P, T, S>(
7660 protocol: P,
7661 transport: T,
7662 spawner: S,
7663 ) -> ::std::sync::Arc<impl GraphStorageService + ::std::marker::Send + ::std::marker::Sync + 'static>
7664 where
7665 P: ::fbthrift::Protocol<Frame = T>,
7666 T: ::fbthrift::Transport,
7667 P::Deserializer: ::std::marker::Send,
7668 S: ::fbthrift::help::Spawner,
7669 {
7670 let _ = protocol;
7671 let _ = spawner;
7672 ::std::sync::Arc::new(GraphStorageServiceImpl::<P, T, S>::new(transport))
7673 }
7674 }
7675
7676 impl<T> dyn GraphStorageServiceExt<T>
7677 where
7678 T: ::fbthrift::Transport,
7679 {
7680 pub fn new<P>(
7681 protocol: P,
7682 transport: T,
7683 ) -> ::std::sync::Arc<impl GraphStorageServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
7684 where
7685 P: ::fbthrift::Protocol<Frame = T>,
7686 P::Deserializer: ::std::marker::Send,
7687 {
7688 let spawner = ::fbthrift::help::NoopSpawner;
7689 Self::with_spawner(protocol, transport, spawner)
7690 }
7691
7692 pub fn with_spawner<P, S>(
7693 protocol: P,
7694 transport: T,
7695 spawner: S,
7696 ) -> ::std::sync::Arc<impl GraphStorageServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
7697 where
7698 P: ::fbthrift::Protocol<Frame = T>,
7699 P::Deserializer: ::std::marker::Send,
7700 S: ::fbthrift::help::Spawner,
7701 {
7702 let _ = protocol;
7703 let _ = spawner;
7704 ::std::sync::Arc::new(GraphStorageServiceImpl::<P, T, S>::new(transport))
7705 }
7706 }
7707
7708 pub type GraphStorageServiceDynClient = <make_GraphStorageService as ::fbthrift::ClientFactory>::Api;
7709 pub type GraphStorageServiceClient = ::std::sync::Arc<GraphStorageServiceDynClient>;
7710
7711 impl ::fbthrift::ClientFactory for make_GraphStorageService {
7714 type Api = dyn GraphStorageService + ::std::marker::Send + ::std::marker::Sync + 'static;
7715
7716 fn with_spawner<P, T, S>(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc<Self::Api>
7717 where
7718 P: ::fbthrift::Protocol<Frame = T>,
7719 T: ::fbthrift::Transport,
7720 P::Deserializer: ::std::marker::Send,
7721 S: ::fbthrift::help::Spawner,
7722 {
7723 <dyn GraphStorageService>::with_spawner(protocol, transport, spawner)
7724 }
7725 }
7726
7727
7728 pub struct StorageAdminServiceImpl<P, T, S = ::fbthrift::NoopSpawner> {
7729 transport: T,
7730 _phantom: ::std::marker::PhantomData<fn() -> (P, S)>,
7731 }
7732
7733 impl<P, T, S> StorageAdminServiceImpl<P, T, S>
7734 where
7735 P: ::fbthrift::Protocol,
7736 T: ::fbthrift::Transport,
7737 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
7738 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
7739 P::Deserializer: ::std::marker::Send,
7740 S: ::fbthrift::help::Spawner,
7741 {
7742 pub fn new(
7743 transport: T,
7744 ) -> Self {
7745 Self {
7746 transport,
7747 _phantom: ::std::marker::PhantomData,
7748 }
7749 }
7750
7751 pub fn transport(&self) -> &T {
7752 &self.transport
7753 }
7754
7755
7756 fn _transLeader_impl(
7757 &self,
7758 arg_req: &crate::types::TransLeaderReq,
7759 rpc_options: T::RpcOptions,
7760 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>> {
7761 use ::const_cstr::const_cstr;
7762 use ::tracing::Instrument as _;
7763 use ::futures::FutureExt as _;
7764
7765 const_cstr! {
7766 SERVICE_NAME = "StorageAdminService";
7767 METHOD_NAME = "StorageAdminService.transLeader";
7768 }
7769 let args = self::Args_StorageAdminService_transLeader {
7770 req: arg_req,
7771 _phantom: ::std::marker::PhantomData,
7772 };
7773
7774 let transport = self.transport();
7775
7776 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("transLeader", &args) {
7778 ::std::result::Result::Ok(res) => res,
7779 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
7780 };
7781
7782 let call = transport
7783 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
7784 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.transLeader"));
7785
7786 async move {
7787 let reply_env = call.await?;
7788
7789 let de = P::deserializer(reply_env);
7790 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::TransLeaderExn, _>, _) =
7791 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
7792
7793 let res = match res {
7794 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
7795 ::std::result::Result::Err(aexn) =>
7796 ::std::result::Result::Err(crate::errors::storage_admin_service::TransLeaderError::ApplicationException(aexn))
7797 };
7798 res
7799 }
7800 .instrument(::tracing::info_span!("StorageAdminService.transLeader"))
7801 .boxed()
7802 }
7803
7804 fn _addPart_impl(
7805 &self,
7806 arg_req: &crate::types::AddPartReq,
7807 rpc_options: T::RpcOptions,
7808 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>> {
7809 use ::const_cstr::const_cstr;
7810 use ::tracing::Instrument as _;
7811 use ::futures::FutureExt as _;
7812
7813 const_cstr! {
7814 SERVICE_NAME = "StorageAdminService";
7815 METHOD_NAME = "StorageAdminService.addPart";
7816 }
7817 let args = self::Args_StorageAdminService_addPart {
7818 req: arg_req,
7819 _phantom: ::std::marker::PhantomData,
7820 };
7821
7822 let transport = self.transport();
7823
7824 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("addPart", &args) {
7826 ::std::result::Result::Ok(res) => res,
7827 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
7828 };
7829
7830 let call = transport
7831 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
7832 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.addPart"));
7833
7834 async move {
7835 let reply_env = call.await?;
7836
7837 let de = P::deserializer(reply_env);
7838 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::AddPartExn, _>, _) =
7839 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
7840
7841 let res = match res {
7842 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
7843 ::std::result::Result::Err(aexn) =>
7844 ::std::result::Result::Err(crate::errors::storage_admin_service::AddPartError::ApplicationException(aexn))
7845 };
7846 res
7847 }
7848 .instrument(::tracing::info_span!("StorageAdminService.addPart"))
7849 .boxed()
7850 }
7851
7852 fn _addLearner_impl(
7853 &self,
7854 arg_req: &crate::types::AddLearnerReq,
7855 rpc_options: T::RpcOptions,
7856 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>> {
7857 use ::const_cstr::const_cstr;
7858 use ::tracing::Instrument as _;
7859 use ::futures::FutureExt as _;
7860
7861 const_cstr! {
7862 SERVICE_NAME = "StorageAdminService";
7863 METHOD_NAME = "StorageAdminService.addLearner";
7864 }
7865 let args = self::Args_StorageAdminService_addLearner {
7866 req: arg_req,
7867 _phantom: ::std::marker::PhantomData,
7868 };
7869
7870 let transport = self.transport();
7871
7872 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("addLearner", &args) {
7874 ::std::result::Result::Ok(res) => res,
7875 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
7876 };
7877
7878 let call = transport
7879 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
7880 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.addLearner"));
7881
7882 async move {
7883 let reply_env = call.await?;
7884
7885 let de = P::deserializer(reply_env);
7886 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::AddLearnerExn, _>, _) =
7887 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
7888
7889 let res = match res {
7890 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
7891 ::std::result::Result::Err(aexn) =>
7892 ::std::result::Result::Err(crate::errors::storage_admin_service::AddLearnerError::ApplicationException(aexn))
7893 };
7894 res
7895 }
7896 .instrument(::tracing::info_span!("StorageAdminService.addLearner"))
7897 .boxed()
7898 }
7899
7900 fn _removePart_impl(
7901 &self,
7902 arg_req: &crate::types::RemovePartReq,
7903 rpc_options: T::RpcOptions,
7904 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>> {
7905 use ::const_cstr::const_cstr;
7906 use ::tracing::Instrument as _;
7907 use ::futures::FutureExt as _;
7908
7909 const_cstr! {
7910 SERVICE_NAME = "StorageAdminService";
7911 METHOD_NAME = "StorageAdminService.removePart";
7912 }
7913 let args = self::Args_StorageAdminService_removePart {
7914 req: arg_req,
7915 _phantom: ::std::marker::PhantomData,
7916 };
7917
7918 let transport = self.transport();
7919
7920 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("removePart", &args) {
7922 ::std::result::Result::Ok(res) => res,
7923 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
7924 };
7925
7926 let call = transport
7927 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
7928 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.removePart"));
7929
7930 async move {
7931 let reply_env = call.await?;
7932
7933 let de = P::deserializer(reply_env);
7934 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::RemovePartExn, _>, _) =
7935 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
7936
7937 let res = match res {
7938 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
7939 ::std::result::Result::Err(aexn) =>
7940 ::std::result::Result::Err(crate::errors::storage_admin_service::RemovePartError::ApplicationException(aexn))
7941 };
7942 res
7943 }
7944 .instrument(::tracing::info_span!("StorageAdminService.removePart"))
7945 .boxed()
7946 }
7947
7948 fn _memberChange_impl(
7949 &self,
7950 arg_req: &crate::types::MemberChangeReq,
7951 rpc_options: T::RpcOptions,
7952 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>> {
7953 use ::const_cstr::const_cstr;
7954 use ::tracing::Instrument as _;
7955 use ::futures::FutureExt as _;
7956
7957 const_cstr! {
7958 SERVICE_NAME = "StorageAdminService";
7959 METHOD_NAME = "StorageAdminService.memberChange";
7960 }
7961 let args = self::Args_StorageAdminService_memberChange {
7962 req: arg_req,
7963 _phantom: ::std::marker::PhantomData,
7964 };
7965
7966 let transport = self.transport();
7967
7968 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("memberChange", &args) {
7970 ::std::result::Result::Ok(res) => res,
7971 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
7972 };
7973
7974 let call = transport
7975 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
7976 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.memberChange"));
7977
7978 async move {
7979 let reply_env = call.await?;
7980
7981 let de = P::deserializer(reply_env);
7982 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::MemberChangeExn, _>, _) =
7983 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
7984
7985 let res = match res {
7986 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
7987 ::std::result::Result::Err(aexn) =>
7988 ::std::result::Result::Err(crate::errors::storage_admin_service::MemberChangeError::ApplicationException(aexn))
7989 };
7990 res
7991 }
7992 .instrument(::tracing::info_span!("StorageAdminService.memberChange"))
7993 .boxed()
7994 }
7995
7996 fn _waitingForCatchUpData_impl(
7997 &self,
7998 arg_req: &crate::types::CatchUpDataReq,
7999 rpc_options: T::RpcOptions,
8000 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>> {
8001 use ::const_cstr::const_cstr;
8002 use ::tracing::Instrument as _;
8003 use ::futures::FutureExt as _;
8004
8005 const_cstr! {
8006 SERVICE_NAME = "StorageAdminService";
8007 METHOD_NAME = "StorageAdminService.waitingForCatchUpData";
8008 }
8009 let args = self::Args_StorageAdminService_waitingForCatchUpData {
8010 req: arg_req,
8011 _phantom: ::std::marker::PhantomData,
8012 };
8013
8014 let transport = self.transport();
8015
8016 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("waitingForCatchUpData", &args) {
8018 ::std::result::Result::Ok(res) => res,
8019 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8020 };
8021
8022 let call = transport
8023 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8024 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.waitingForCatchUpData"));
8025
8026 async move {
8027 let reply_env = call.await?;
8028
8029 let de = P::deserializer(reply_env);
8030 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::WaitingForCatchUpDataExn, _>, _) =
8031 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8032
8033 let res = match res {
8034 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8035 ::std::result::Result::Err(aexn) =>
8036 ::std::result::Result::Err(crate::errors::storage_admin_service::WaitingForCatchUpDataError::ApplicationException(aexn))
8037 };
8038 res
8039 }
8040 .instrument(::tracing::info_span!("StorageAdminService.waitingForCatchUpData"))
8041 .boxed()
8042 }
8043
8044 fn _createCheckpoint_impl(
8045 &self,
8046 arg_req: &crate::types::CreateCPRequest,
8047 rpc_options: T::RpcOptions,
8048 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>> {
8049 use ::const_cstr::const_cstr;
8050 use ::tracing::Instrument as _;
8051 use ::futures::FutureExt as _;
8052
8053 const_cstr! {
8054 SERVICE_NAME = "StorageAdminService";
8055 METHOD_NAME = "StorageAdminService.createCheckpoint";
8056 }
8057 let args = self::Args_StorageAdminService_createCheckpoint {
8058 req: arg_req,
8059 _phantom: ::std::marker::PhantomData,
8060 };
8061
8062 let transport = self.transport();
8063
8064 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("createCheckpoint", &args) {
8066 ::std::result::Result::Ok(res) => res,
8067 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8068 };
8069
8070 let call = transport
8071 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8072 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.createCheckpoint"));
8073
8074 async move {
8075 let reply_env = call.await?;
8076
8077 let de = P::deserializer(reply_env);
8078 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::CreateCheckpointExn, _>, _) =
8079 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8080
8081 let res = match res {
8082 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8083 ::std::result::Result::Err(aexn) =>
8084 ::std::result::Result::Err(crate::errors::storage_admin_service::CreateCheckpointError::ApplicationException(aexn))
8085 };
8086 res
8087 }
8088 .instrument(::tracing::info_span!("StorageAdminService.createCheckpoint"))
8089 .boxed()
8090 }
8091
8092 fn _dropCheckpoint_impl(
8093 &self,
8094 arg_req: &crate::types::DropCPRequest,
8095 rpc_options: T::RpcOptions,
8096 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>> {
8097 use ::const_cstr::const_cstr;
8098 use ::tracing::Instrument as _;
8099 use ::futures::FutureExt as _;
8100
8101 const_cstr! {
8102 SERVICE_NAME = "StorageAdminService";
8103 METHOD_NAME = "StorageAdminService.dropCheckpoint";
8104 }
8105 let args = self::Args_StorageAdminService_dropCheckpoint {
8106 req: arg_req,
8107 _phantom: ::std::marker::PhantomData,
8108 };
8109
8110 let transport = self.transport();
8111
8112 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("dropCheckpoint", &args) {
8114 ::std::result::Result::Ok(res) => res,
8115 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8116 };
8117
8118 let call = transport
8119 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8120 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.dropCheckpoint"));
8121
8122 async move {
8123 let reply_env = call.await?;
8124
8125 let de = P::deserializer(reply_env);
8126 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::DropCheckpointExn, _>, _) =
8127 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8128
8129 let res = match res {
8130 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8131 ::std::result::Result::Err(aexn) =>
8132 ::std::result::Result::Err(crate::errors::storage_admin_service::DropCheckpointError::ApplicationException(aexn))
8133 };
8134 res
8135 }
8136 .instrument(::tracing::info_span!("StorageAdminService.dropCheckpoint"))
8137 .boxed()
8138 }
8139
8140 fn _blockingWrites_impl(
8141 &self,
8142 arg_req: &crate::types::BlockingSignRequest,
8143 rpc_options: T::RpcOptions,
8144 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>> {
8145 use ::const_cstr::const_cstr;
8146 use ::tracing::Instrument as _;
8147 use ::futures::FutureExt as _;
8148
8149 const_cstr! {
8150 SERVICE_NAME = "StorageAdminService";
8151 METHOD_NAME = "StorageAdminService.blockingWrites";
8152 }
8153 let args = self::Args_StorageAdminService_blockingWrites {
8154 req: arg_req,
8155 _phantom: ::std::marker::PhantomData,
8156 };
8157
8158 let transport = self.transport();
8159
8160 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("blockingWrites", &args) {
8162 ::std::result::Result::Ok(res) => res,
8163 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8164 };
8165
8166 let call = transport
8167 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8168 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.blockingWrites"));
8169
8170 async move {
8171 let reply_env = call.await?;
8172
8173 let de = P::deserializer(reply_env);
8174 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::BlockingWritesExn, _>, _) =
8175 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8176
8177 let res = match res {
8178 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8179 ::std::result::Result::Err(aexn) =>
8180 ::std::result::Result::Err(crate::errors::storage_admin_service::BlockingWritesError::ApplicationException(aexn))
8181 };
8182 res
8183 }
8184 .instrument(::tracing::info_span!("StorageAdminService.blockingWrites"))
8185 .boxed()
8186 }
8187
8188 fn _getLeaderParts_impl(
8189 &self,
8190 arg_req: &crate::types::GetLeaderReq,
8191 rpc_options: T::RpcOptions,
8192 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>> {
8193 use ::const_cstr::const_cstr;
8194 use ::tracing::Instrument as _;
8195 use ::futures::FutureExt as _;
8196
8197 const_cstr! {
8198 SERVICE_NAME = "StorageAdminService";
8199 METHOD_NAME = "StorageAdminService.getLeaderParts";
8200 }
8201 let args = self::Args_StorageAdminService_getLeaderParts {
8202 req: arg_req,
8203 _phantom: ::std::marker::PhantomData,
8204 };
8205
8206 let transport = self.transport();
8207
8208 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("getLeaderParts", &args) {
8210 ::std::result::Result::Ok(res) => res,
8211 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8212 };
8213
8214 let call = transport
8215 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8216 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.getLeaderParts"));
8217
8218 async move {
8219 let reply_env = call.await?;
8220
8221 let de = P::deserializer(reply_env);
8222 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::GetLeaderPartsExn, _>, _) =
8223 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8224
8225 let res = match res {
8226 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8227 ::std::result::Result::Err(aexn) =>
8228 ::std::result::Result::Err(crate::errors::storage_admin_service::GetLeaderPartsError::ApplicationException(aexn))
8229 };
8230 res
8231 }
8232 .instrument(::tracing::info_span!("StorageAdminService.getLeaderParts"))
8233 .boxed()
8234 }
8235
8236 fn _checkPeers_impl(
8237 &self,
8238 arg_req: &crate::types::CheckPeersReq,
8239 rpc_options: T::RpcOptions,
8240 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>> {
8241 use ::const_cstr::const_cstr;
8242 use ::tracing::Instrument as _;
8243 use ::futures::FutureExt as _;
8244
8245 const_cstr! {
8246 SERVICE_NAME = "StorageAdminService";
8247 METHOD_NAME = "StorageAdminService.checkPeers";
8248 }
8249 let args = self::Args_StorageAdminService_checkPeers {
8250 req: arg_req,
8251 _phantom: ::std::marker::PhantomData,
8252 };
8253
8254 let transport = self.transport();
8255
8256 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("checkPeers", &args) {
8258 ::std::result::Result::Ok(res) => res,
8259 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8260 };
8261
8262 let call = transport
8263 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8264 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.checkPeers"));
8265
8266 async move {
8267 let reply_env = call.await?;
8268
8269 let de = P::deserializer(reply_env);
8270 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::CheckPeersExn, _>, _) =
8271 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8272
8273 let res = match res {
8274 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8275 ::std::result::Result::Err(aexn) =>
8276 ::std::result::Result::Err(crate::errors::storage_admin_service::CheckPeersError::ApplicationException(aexn))
8277 };
8278 res
8279 }
8280 .instrument(::tracing::info_span!("StorageAdminService.checkPeers"))
8281 .boxed()
8282 }
8283
8284 fn _addAdminTask_impl(
8285 &self,
8286 arg_req: &crate::types::AddTaskRequest,
8287 rpc_options: T::RpcOptions,
8288 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>> {
8289 use ::const_cstr::const_cstr;
8290 use ::tracing::Instrument as _;
8291 use ::futures::FutureExt as _;
8292
8293 const_cstr! {
8294 SERVICE_NAME = "StorageAdminService";
8295 METHOD_NAME = "StorageAdminService.addAdminTask";
8296 }
8297 let args = self::Args_StorageAdminService_addAdminTask {
8298 req: arg_req,
8299 _phantom: ::std::marker::PhantomData,
8300 };
8301
8302 let transport = self.transport();
8303
8304 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("addAdminTask", &args) {
8306 ::std::result::Result::Ok(res) => res,
8307 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8308 };
8309
8310 let call = transport
8311 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8312 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.addAdminTask"));
8313
8314 async move {
8315 let reply_env = call.await?;
8316
8317 let de = P::deserializer(reply_env);
8318 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::AddAdminTaskExn, _>, _) =
8319 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8320
8321 let res = match res {
8322 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8323 ::std::result::Result::Err(aexn) =>
8324 ::std::result::Result::Err(crate::errors::storage_admin_service::AddAdminTaskError::ApplicationException(aexn))
8325 };
8326 res
8327 }
8328 .instrument(::tracing::info_span!("StorageAdminService.addAdminTask"))
8329 .boxed()
8330 }
8331
8332 fn _stopAdminTask_impl(
8333 &self,
8334 arg_req: &crate::types::StopTaskRequest,
8335 rpc_options: T::RpcOptions,
8336 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>> {
8337 use ::const_cstr::const_cstr;
8338 use ::tracing::Instrument as _;
8339 use ::futures::FutureExt as _;
8340
8341 const_cstr! {
8342 SERVICE_NAME = "StorageAdminService";
8343 METHOD_NAME = "StorageAdminService.stopAdminTask";
8344 }
8345 let args = self::Args_StorageAdminService_stopAdminTask {
8346 req: arg_req,
8347 _phantom: ::std::marker::PhantomData,
8348 };
8349
8350 let transport = self.transport();
8351
8352 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("stopAdminTask", &args) {
8354 ::std::result::Result::Ok(res) => res,
8355 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8356 };
8357
8358 let call = transport
8359 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8360 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.stopAdminTask"));
8361
8362 async move {
8363 let reply_env = call.await?;
8364
8365 let de = P::deserializer(reply_env);
8366 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::StopAdminTaskExn, _>, _) =
8367 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8368
8369 let res = match res {
8370 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8371 ::std::result::Result::Err(aexn) =>
8372 ::std::result::Result::Err(crate::errors::storage_admin_service::StopAdminTaskError::ApplicationException(aexn))
8373 };
8374 res
8375 }
8376 .instrument(::tracing::info_span!("StorageAdminService.stopAdminTask"))
8377 .boxed()
8378 }
8379
8380 fn _clearSpace_impl(
8381 &self,
8382 arg_req: &crate::types::ClearSpaceReq,
8383 rpc_options: T::RpcOptions,
8384 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>> {
8385 use ::const_cstr::const_cstr;
8386 use ::tracing::Instrument as _;
8387 use ::futures::FutureExt as _;
8388
8389 const_cstr! {
8390 SERVICE_NAME = "StorageAdminService";
8391 METHOD_NAME = "StorageAdminService.clearSpace";
8392 }
8393 let args = self::Args_StorageAdminService_clearSpace {
8394 req: arg_req,
8395 _phantom: ::std::marker::PhantomData,
8396 };
8397
8398 let transport = self.transport();
8399
8400 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("clearSpace", &args) {
8402 ::std::result::Result::Ok(res) => res,
8403 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
8404 };
8405
8406 let call = transport
8407 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
8408 .instrument(::tracing::trace_span!("call", function = "StorageAdminService.clearSpace"));
8409
8410 async move {
8411 let reply_env = call.await?;
8412
8413 let de = P::deserializer(reply_env);
8414 let (res, _de): (::std::result::Result<crate::services::storage_admin_service::ClearSpaceExn, _>, _) =
8415 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
8416
8417 let res = match res {
8418 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
8419 ::std::result::Result::Err(aexn) =>
8420 ::std::result::Result::Err(crate::errors::storage_admin_service::ClearSpaceError::ApplicationException(aexn))
8421 };
8422 res
8423 }
8424 .instrument(::tracing::info_span!("StorageAdminService.clearSpace"))
8425 .boxed()
8426 }
8427 }
8428
8429 pub trait StorageAdminService: ::std::marker::Send {
8430 fn transLeader(
8431 &self,
8432 arg_req: &crate::types::TransLeaderReq,
8433 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>>;
8434
8435 fn addPart(
8436 &self,
8437 arg_req: &crate::types::AddPartReq,
8438 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>>;
8439
8440 fn addLearner(
8441 &self,
8442 arg_req: &crate::types::AddLearnerReq,
8443 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>>;
8444
8445 fn removePart(
8446 &self,
8447 arg_req: &crate::types::RemovePartReq,
8448 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>>;
8449
8450 fn memberChange(
8451 &self,
8452 arg_req: &crate::types::MemberChangeReq,
8453 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>>;
8454
8455 fn waitingForCatchUpData(
8456 &self,
8457 arg_req: &crate::types::CatchUpDataReq,
8458 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>>;
8459
8460 fn createCheckpoint(
8461 &self,
8462 arg_req: &crate::types::CreateCPRequest,
8463 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>>;
8464
8465 fn dropCheckpoint(
8466 &self,
8467 arg_req: &crate::types::DropCPRequest,
8468 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>>;
8469
8470 fn blockingWrites(
8471 &self,
8472 arg_req: &crate::types::BlockingSignRequest,
8473 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>>;
8474
8475 fn getLeaderParts(
8476 &self,
8477 arg_req: &crate::types::GetLeaderReq,
8478 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>>;
8479
8480 fn checkPeers(
8481 &self,
8482 arg_req: &crate::types::CheckPeersReq,
8483 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>>;
8484
8485 fn addAdminTask(
8486 &self,
8487 arg_req: &crate::types::AddTaskRequest,
8488 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>>;
8489
8490 fn stopAdminTask(
8491 &self,
8492 arg_req: &crate::types::StopTaskRequest,
8493 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>>;
8494
8495 fn clearSpace(
8496 &self,
8497 arg_req: &crate::types::ClearSpaceReq,
8498 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>>;
8499 }
8500
8501 pub trait StorageAdminServiceExt<T>: StorageAdminService
8502 where
8503 T: ::fbthrift::Transport,
8504 {
8505 fn transLeader_with_rpc_opts(
8506 &self,
8507 arg_req: &crate::types::TransLeaderReq,
8508 rpc_options: T::RpcOptions,
8509 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>>;
8510 fn addPart_with_rpc_opts(
8511 &self,
8512 arg_req: &crate::types::AddPartReq,
8513 rpc_options: T::RpcOptions,
8514 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>>;
8515 fn addLearner_with_rpc_opts(
8516 &self,
8517 arg_req: &crate::types::AddLearnerReq,
8518 rpc_options: T::RpcOptions,
8519 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>>;
8520 fn removePart_with_rpc_opts(
8521 &self,
8522 arg_req: &crate::types::RemovePartReq,
8523 rpc_options: T::RpcOptions,
8524 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>>;
8525 fn memberChange_with_rpc_opts(
8526 &self,
8527 arg_req: &crate::types::MemberChangeReq,
8528 rpc_options: T::RpcOptions,
8529 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>>;
8530 fn waitingForCatchUpData_with_rpc_opts(
8531 &self,
8532 arg_req: &crate::types::CatchUpDataReq,
8533 rpc_options: T::RpcOptions,
8534 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>>;
8535 fn createCheckpoint_with_rpc_opts(
8536 &self,
8537 arg_req: &crate::types::CreateCPRequest,
8538 rpc_options: T::RpcOptions,
8539 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>>;
8540 fn dropCheckpoint_with_rpc_opts(
8541 &self,
8542 arg_req: &crate::types::DropCPRequest,
8543 rpc_options: T::RpcOptions,
8544 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>>;
8545 fn blockingWrites_with_rpc_opts(
8546 &self,
8547 arg_req: &crate::types::BlockingSignRequest,
8548 rpc_options: T::RpcOptions,
8549 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>>;
8550 fn getLeaderParts_with_rpc_opts(
8551 &self,
8552 arg_req: &crate::types::GetLeaderReq,
8553 rpc_options: T::RpcOptions,
8554 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>>;
8555 fn checkPeers_with_rpc_opts(
8556 &self,
8557 arg_req: &crate::types::CheckPeersReq,
8558 rpc_options: T::RpcOptions,
8559 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>>;
8560 fn addAdminTask_with_rpc_opts(
8561 &self,
8562 arg_req: &crate::types::AddTaskRequest,
8563 rpc_options: T::RpcOptions,
8564 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>>;
8565 fn stopAdminTask_with_rpc_opts(
8566 &self,
8567 arg_req: &crate::types::StopTaskRequest,
8568 rpc_options: T::RpcOptions,
8569 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>>;
8570 fn clearSpace_with_rpc_opts(
8571 &self,
8572 arg_req: &crate::types::ClearSpaceReq,
8573 rpc_options: T::RpcOptions,
8574 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>>;
8575 }
8576
8577 struct Args_StorageAdminService_transLeader<'a> {
8578 req: &'a crate::types::TransLeaderReq,
8579 _phantom: ::std::marker::PhantomData<&'a ()>,
8580 }
8581
8582 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_transLeader<'a> {
8583 #[inline]
8584 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.transLeader"))]
8585 fn write(&self, p: &mut P) {
8586 p.write_struct_begin("args");
8587 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8588 ::fbthrift::Serialize::write(&self.req, p);
8589 p.write_field_end();
8590 p.write_field_stop();
8591 p.write_struct_end();
8592 }
8593 }
8594
8595 struct Args_StorageAdminService_addPart<'a> {
8596 req: &'a crate::types::AddPartReq,
8597 _phantom: ::std::marker::PhantomData<&'a ()>,
8598 }
8599
8600 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_addPart<'a> {
8601 #[inline]
8602 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.addPart"))]
8603 fn write(&self, p: &mut P) {
8604 p.write_struct_begin("args");
8605 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8606 ::fbthrift::Serialize::write(&self.req, p);
8607 p.write_field_end();
8608 p.write_field_stop();
8609 p.write_struct_end();
8610 }
8611 }
8612
8613 struct Args_StorageAdminService_addLearner<'a> {
8614 req: &'a crate::types::AddLearnerReq,
8615 _phantom: ::std::marker::PhantomData<&'a ()>,
8616 }
8617
8618 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_addLearner<'a> {
8619 #[inline]
8620 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.addLearner"))]
8621 fn write(&self, p: &mut P) {
8622 p.write_struct_begin("args");
8623 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8624 ::fbthrift::Serialize::write(&self.req, p);
8625 p.write_field_end();
8626 p.write_field_stop();
8627 p.write_struct_end();
8628 }
8629 }
8630
8631 struct Args_StorageAdminService_removePart<'a> {
8632 req: &'a crate::types::RemovePartReq,
8633 _phantom: ::std::marker::PhantomData<&'a ()>,
8634 }
8635
8636 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_removePart<'a> {
8637 #[inline]
8638 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.removePart"))]
8639 fn write(&self, p: &mut P) {
8640 p.write_struct_begin("args");
8641 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8642 ::fbthrift::Serialize::write(&self.req, p);
8643 p.write_field_end();
8644 p.write_field_stop();
8645 p.write_struct_end();
8646 }
8647 }
8648
8649 struct Args_StorageAdminService_memberChange<'a> {
8650 req: &'a crate::types::MemberChangeReq,
8651 _phantom: ::std::marker::PhantomData<&'a ()>,
8652 }
8653
8654 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_memberChange<'a> {
8655 #[inline]
8656 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.memberChange"))]
8657 fn write(&self, p: &mut P) {
8658 p.write_struct_begin("args");
8659 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8660 ::fbthrift::Serialize::write(&self.req, p);
8661 p.write_field_end();
8662 p.write_field_stop();
8663 p.write_struct_end();
8664 }
8665 }
8666
8667 struct Args_StorageAdminService_waitingForCatchUpData<'a> {
8668 req: &'a crate::types::CatchUpDataReq,
8669 _phantom: ::std::marker::PhantomData<&'a ()>,
8670 }
8671
8672 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_waitingForCatchUpData<'a> {
8673 #[inline]
8674 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.waitingForCatchUpData"))]
8675 fn write(&self, p: &mut P) {
8676 p.write_struct_begin("args");
8677 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8678 ::fbthrift::Serialize::write(&self.req, p);
8679 p.write_field_end();
8680 p.write_field_stop();
8681 p.write_struct_end();
8682 }
8683 }
8684
8685 struct Args_StorageAdminService_createCheckpoint<'a> {
8686 req: &'a crate::types::CreateCPRequest,
8687 _phantom: ::std::marker::PhantomData<&'a ()>,
8688 }
8689
8690 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_createCheckpoint<'a> {
8691 #[inline]
8692 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.createCheckpoint"))]
8693 fn write(&self, p: &mut P) {
8694 p.write_struct_begin("args");
8695 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8696 ::fbthrift::Serialize::write(&self.req, p);
8697 p.write_field_end();
8698 p.write_field_stop();
8699 p.write_struct_end();
8700 }
8701 }
8702
8703 struct Args_StorageAdminService_dropCheckpoint<'a> {
8704 req: &'a crate::types::DropCPRequest,
8705 _phantom: ::std::marker::PhantomData<&'a ()>,
8706 }
8707
8708 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_dropCheckpoint<'a> {
8709 #[inline]
8710 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.dropCheckpoint"))]
8711 fn write(&self, p: &mut P) {
8712 p.write_struct_begin("args");
8713 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8714 ::fbthrift::Serialize::write(&self.req, p);
8715 p.write_field_end();
8716 p.write_field_stop();
8717 p.write_struct_end();
8718 }
8719 }
8720
8721 struct Args_StorageAdminService_blockingWrites<'a> {
8722 req: &'a crate::types::BlockingSignRequest,
8723 _phantom: ::std::marker::PhantomData<&'a ()>,
8724 }
8725
8726 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_blockingWrites<'a> {
8727 #[inline]
8728 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.blockingWrites"))]
8729 fn write(&self, p: &mut P) {
8730 p.write_struct_begin("args");
8731 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8732 ::fbthrift::Serialize::write(&self.req, p);
8733 p.write_field_end();
8734 p.write_field_stop();
8735 p.write_struct_end();
8736 }
8737 }
8738
8739 struct Args_StorageAdminService_getLeaderParts<'a> {
8740 req: &'a crate::types::GetLeaderReq,
8741 _phantom: ::std::marker::PhantomData<&'a ()>,
8742 }
8743
8744 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_getLeaderParts<'a> {
8745 #[inline]
8746 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.getLeaderParts"))]
8747 fn write(&self, p: &mut P) {
8748 p.write_struct_begin("args");
8749 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8750 ::fbthrift::Serialize::write(&self.req, p);
8751 p.write_field_end();
8752 p.write_field_stop();
8753 p.write_struct_end();
8754 }
8755 }
8756
8757 struct Args_StorageAdminService_checkPeers<'a> {
8758 req: &'a crate::types::CheckPeersReq,
8759 _phantom: ::std::marker::PhantomData<&'a ()>,
8760 }
8761
8762 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_checkPeers<'a> {
8763 #[inline]
8764 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.checkPeers"))]
8765 fn write(&self, p: &mut P) {
8766 p.write_struct_begin("args");
8767 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8768 ::fbthrift::Serialize::write(&self.req, p);
8769 p.write_field_end();
8770 p.write_field_stop();
8771 p.write_struct_end();
8772 }
8773 }
8774
8775 struct Args_StorageAdminService_addAdminTask<'a> {
8776 req: &'a crate::types::AddTaskRequest,
8777 _phantom: ::std::marker::PhantomData<&'a ()>,
8778 }
8779
8780 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_addAdminTask<'a> {
8781 #[inline]
8782 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.addAdminTask"))]
8783 fn write(&self, p: &mut P) {
8784 p.write_struct_begin("args");
8785 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8786 ::fbthrift::Serialize::write(&self.req, p);
8787 p.write_field_end();
8788 p.write_field_stop();
8789 p.write_struct_end();
8790 }
8791 }
8792
8793 struct Args_StorageAdminService_stopAdminTask<'a> {
8794 req: &'a crate::types::StopTaskRequest,
8795 _phantom: ::std::marker::PhantomData<&'a ()>,
8796 }
8797
8798 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_stopAdminTask<'a> {
8799 #[inline]
8800 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.stopAdminTask"))]
8801 fn write(&self, p: &mut P) {
8802 p.write_struct_begin("args");
8803 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8804 ::fbthrift::Serialize::write(&self.req, p);
8805 p.write_field_end();
8806 p.write_field_stop();
8807 p.write_struct_end();
8808 }
8809 }
8810
8811 struct Args_StorageAdminService_clearSpace<'a> {
8812 req: &'a crate::types::ClearSpaceReq,
8813 _phantom: ::std::marker::PhantomData<&'a ()>,
8814 }
8815
8816 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_StorageAdminService_clearSpace<'a> {
8817 #[inline]
8818 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "StorageAdminService.clearSpace"))]
8819 fn write(&self, p: &mut P) {
8820 p.write_struct_begin("args");
8821 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
8822 ::fbthrift::Serialize::write(&self.req, p);
8823 p.write_field_end();
8824 p.write_field_stop();
8825 p.write_struct_end();
8826 }
8827 }
8828
8829 impl<P, T, S> StorageAdminService for StorageAdminServiceImpl<P, T, S>
8830 where
8831 P: ::fbthrift::Protocol,
8832 T: ::fbthrift::Transport,
8833 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
8834 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
8835 P::Deserializer: ::std::marker::Send,
8836 S: ::fbthrift::help::Spawner,
8837 {
8838 fn transLeader(
8839 &self,
8840 arg_req: &crate::types::TransLeaderReq,
8841 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>> {
8842 let rpc_options = T::RpcOptions::default();
8843 self._transLeader_impl(
8844 arg_req,
8845 rpc_options,
8846 )
8847 }
8848 fn addPart(
8849 &self,
8850 arg_req: &crate::types::AddPartReq,
8851 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>> {
8852 let rpc_options = T::RpcOptions::default();
8853 self._addPart_impl(
8854 arg_req,
8855 rpc_options,
8856 )
8857 }
8858 fn addLearner(
8859 &self,
8860 arg_req: &crate::types::AddLearnerReq,
8861 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>> {
8862 let rpc_options = T::RpcOptions::default();
8863 self._addLearner_impl(
8864 arg_req,
8865 rpc_options,
8866 )
8867 }
8868 fn removePart(
8869 &self,
8870 arg_req: &crate::types::RemovePartReq,
8871 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>> {
8872 let rpc_options = T::RpcOptions::default();
8873 self._removePart_impl(
8874 arg_req,
8875 rpc_options,
8876 )
8877 }
8878 fn memberChange(
8879 &self,
8880 arg_req: &crate::types::MemberChangeReq,
8881 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>> {
8882 let rpc_options = T::RpcOptions::default();
8883 self._memberChange_impl(
8884 arg_req,
8885 rpc_options,
8886 )
8887 }
8888 fn waitingForCatchUpData(
8889 &self,
8890 arg_req: &crate::types::CatchUpDataReq,
8891 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>> {
8892 let rpc_options = T::RpcOptions::default();
8893 self._waitingForCatchUpData_impl(
8894 arg_req,
8895 rpc_options,
8896 )
8897 }
8898 fn createCheckpoint(
8899 &self,
8900 arg_req: &crate::types::CreateCPRequest,
8901 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>> {
8902 let rpc_options = T::RpcOptions::default();
8903 self._createCheckpoint_impl(
8904 arg_req,
8905 rpc_options,
8906 )
8907 }
8908 fn dropCheckpoint(
8909 &self,
8910 arg_req: &crate::types::DropCPRequest,
8911 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>> {
8912 let rpc_options = T::RpcOptions::default();
8913 self._dropCheckpoint_impl(
8914 arg_req,
8915 rpc_options,
8916 )
8917 }
8918 fn blockingWrites(
8919 &self,
8920 arg_req: &crate::types::BlockingSignRequest,
8921 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>> {
8922 let rpc_options = T::RpcOptions::default();
8923 self._blockingWrites_impl(
8924 arg_req,
8925 rpc_options,
8926 )
8927 }
8928 fn getLeaderParts(
8929 &self,
8930 arg_req: &crate::types::GetLeaderReq,
8931 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>> {
8932 let rpc_options = T::RpcOptions::default();
8933 self._getLeaderParts_impl(
8934 arg_req,
8935 rpc_options,
8936 )
8937 }
8938 fn checkPeers(
8939 &self,
8940 arg_req: &crate::types::CheckPeersReq,
8941 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>> {
8942 let rpc_options = T::RpcOptions::default();
8943 self._checkPeers_impl(
8944 arg_req,
8945 rpc_options,
8946 )
8947 }
8948 fn addAdminTask(
8949 &self,
8950 arg_req: &crate::types::AddTaskRequest,
8951 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>> {
8952 let rpc_options = T::RpcOptions::default();
8953 self._addAdminTask_impl(
8954 arg_req,
8955 rpc_options,
8956 )
8957 }
8958 fn stopAdminTask(
8959 &self,
8960 arg_req: &crate::types::StopTaskRequest,
8961 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>> {
8962 let rpc_options = T::RpcOptions::default();
8963 self._stopAdminTask_impl(
8964 arg_req,
8965 rpc_options,
8966 )
8967 }
8968 fn clearSpace(
8969 &self,
8970 arg_req: &crate::types::ClearSpaceReq,
8971 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>> {
8972 let rpc_options = T::RpcOptions::default();
8973 self._clearSpace_impl(
8974 arg_req,
8975 rpc_options,
8976 )
8977 }
8978 }
8979
8980 impl<P, T, S> StorageAdminServiceExt<T> for StorageAdminServiceImpl<P, T, S>
8981 where
8982 P: ::fbthrift::Protocol,
8983 T: ::fbthrift::Transport,
8984 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
8985 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
8986 P::Deserializer: ::std::marker::Send,
8987 S: ::fbthrift::help::Spawner,
8988 {
8989 fn transLeader_with_rpc_opts(
8990 &self,
8991 arg_req: &crate::types::TransLeaderReq,
8992 rpc_options: T::RpcOptions,
8993 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>> {
8994 self._transLeader_impl(
8995 arg_req,
8996 rpc_options,
8997 )
8998 }
8999 fn addPart_with_rpc_opts(
9000 &self,
9001 arg_req: &crate::types::AddPartReq,
9002 rpc_options: T::RpcOptions,
9003 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>> {
9004 self._addPart_impl(
9005 arg_req,
9006 rpc_options,
9007 )
9008 }
9009 fn addLearner_with_rpc_opts(
9010 &self,
9011 arg_req: &crate::types::AddLearnerReq,
9012 rpc_options: T::RpcOptions,
9013 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>> {
9014 self._addLearner_impl(
9015 arg_req,
9016 rpc_options,
9017 )
9018 }
9019 fn removePart_with_rpc_opts(
9020 &self,
9021 arg_req: &crate::types::RemovePartReq,
9022 rpc_options: T::RpcOptions,
9023 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>> {
9024 self._removePart_impl(
9025 arg_req,
9026 rpc_options,
9027 )
9028 }
9029 fn memberChange_with_rpc_opts(
9030 &self,
9031 arg_req: &crate::types::MemberChangeReq,
9032 rpc_options: T::RpcOptions,
9033 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>> {
9034 self._memberChange_impl(
9035 arg_req,
9036 rpc_options,
9037 )
9038 }
9039 fn waitingForCatchUpData_with_rpc_opts(
9040 &self,
9041 arg_req: &crate::types::CatchUpDataReq,
9042 rpc_options: T::RpcOptions,
9043 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>> {
9044 self._waitingForCatchUpData_impl(
9045 arg_req,
9046 rpc_options,
9047 )
9048 }
9049 fn createCheckpoint_with_rpc_opts(
9050 &self,
9051 arg_req: &crate::types::CreateCPRequest,
9052 rpc_options: T::RpcOptions,
9053 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>> {
9054 self._createCheckpoint_impl(
9055 arg_req,
9056 rpc_options,
9057 )
9058 }
9059 fn dropCheckpoint_with_rpc_opts(
9060 &self,
9061 arg_req: &crate::types::DropCPRequest,
9062 rpc_options: T::RpcOptions,
9063 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>> {
9064 self._dropCheckpoint_impl(
9065 arg_req,
9066 rpc_options,
9067 )
9068 }
9069 fn blockingWrites_with_rpc_opts(
9070 &self,
9071 arg_req: &crate::types::BlockingSignRequest,
9072 rpc_options: T::RpcOptions,
9073 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>> {
9074 self._blockingWrites_impl(
9075 arg_req,
9076 rpc_options,
9077 )
9078 }
9079 fn getLeaderParts_with_rpc_opts(
9080 &self,
9081 arg_req: &crate::types::GetLeaderReq,
9082 rpc_options: T::RpcOptions,
9083 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>> {
9084 self._getLeaderParts_impl(
9085 arg_req,
9086 rpc_options,
9087 )
9088 }
9089 fn checkPeers_with_rpc_opts(
9090 &self,
9091 arg_req: &crate::types::CheckPeersReq,
9092 rpc_options: T::RpcOptions,
9093 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>> {
9094 self._checkPeers_impl(
9095 arg_req,
9096 rpc_options,
9097 )
9098 }
9099 fn addAdminTask_with_rpc_opts(
9100 &self,
9101 arg_req: &crate::types::AddTaskRequest,
9102 rpc_options: T::RpcOptions,
9103 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>> {
9104 self._addAdminTask_impl(
9105 arg_req,
9106 rpc_options,
9107 )
9108 }
9109 fn stopAdminTask_with_rpc_opts(
9110 &self,
9111 arg_req: &crate::types::StopTaskRequest,
9112 rpc_options: T::RpcOptions,
9113 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>> {
9114 self._stopAdminTask_impl(
9115 arg_req,
9116 rpc_options,
9117 )
9118 }
9119 fn clearSpace_with_rpc_opts(
9120 &self,
9121 arg_req: &crate::types::ClearSpaceReq,
9122 rpc_options: T::RpcOptions,
9123 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>> {
9124 self._clearSpace_impl(
9125 arg_req,
9126 rpc_options,
9127 )
9128 }
9129 }
9130
9131 impl<'a, S> StorageAdminService for S
9132 where
9133 S: ::std::convert::AsRef<dyn StorageAdminService + 'a>,
9134 S: ::std::marker::Send,
9135 {
9136 fn transLeader(
9137 &self,
9138 arg_req: &crate::types::TransLeaderReq,
9139 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>> {
9140 self.as_ref().transLeader(
9141 arg_req,
9142 )
9143 }
9144 fn addPart(
9145 &self,
9146 arg_req: &crate::types::AddPartReq,
9147 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>> {
9148 self.as_ref().addPart(
9149 arg_req,
9150 )
9151 }
9152 fn addLearner(
9153 &self,
9154 arg_req: &crate::types::AddLearnerReq,
9155 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>> {
9156 self.as_ref().addLearner(
9157 arg_req,
9158 )
9159 }
9160 fn removePart(
9161 &self,
9162 arg_req: &crate::types::RemovePartReq,
9163 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>> {
9164 self.as_ref().removePart(
9165 arg_req,
9166 )
9167 }
9168 fn memberChange(
9169 &self,
9170 arg_req: &crate::types::MemberChangeReq,
9171 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>> {
9172 self.as_ref().memberChange(
9173 arg_req,
9174 )
9175 }
9176 fn waitingForCatchUpData(
9177 &self,
9178 arg_req: &crate::types::CatchUpDataReq,
9179 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>> {
9180 self.as_ref().waitingForCatchUpData(
9181 arg_req,
9182 )
9183 }
9184 fn createCheckpoint(
9185 &self,
9186 arg_req: &crate::types::CreateCPRequest,
9187 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>> {
9188 self.as_ref().createCheckpoint(
9189 arg_req,
9190 )
9191 }
9192 fn dropCheckpoint(
9193 &self,
9194 arg_req: &crate::types::DropCPRequest,
9195 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>> {
9196 self.as_ref().dropCheckpoint(
9197 arg_req,
9198 )
9199 }
9200 fn blockingWrites(
9201 &self,
9202 arg_req: &crate::types::BlockingSignRequest,
9203 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>> {
9204 self.as_ref().blockingWrites(
9205 arg_req,
9206 )
9207 }
9208 fn getLeaderParts(
9209 &self,
9210 arg_req: &crate::types::GetLeaderReq,
9211 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>> {
9212 self.as_ref().getLeaderParts(
9213 arg_req,
9214 )
9215 }
9216 fn checkPeers(
9217 &self,
9218 arg_req: &crate::types::CheckPeersReq,
9219 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>> {
9220 self.as_ref().checkPeers(
9221 arg_req,
9222 )
9223 }
9224 fn addAdminTask(
9225 &self,
9226 arg_req: &crate::types::AddTaskRequest,
9227 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>> {
9228 self.as_ref().addAdminTask(
9229 arg_req,
9230 )
9231 }
9232 fn stopAdminTask(
9233 &self,
9234 arg_req: &crate::types::StopTaskRequest,
9235 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>> {
9236 self.as_ref().stopAdminTask(
9237 arg_req,
9238 )
9239 }
9240 fn clearSpace(
9241 &self,
9242 arg_req: &crate::types::ClearSpaceReq,
9243 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>> {
9244 self.as_ref().clearSpace(
9245 arg_req,
9246 )
9247 }
9248 }
9249
9250 impl<'a, S, T> StorageAdminServiceExt<T> for S
9251 where
9252 S: ::std::convert::AsRef<dyn StorageAdminService + 'a>,
9253 S: ::std::convert::AsRef<dyn StorageAdminServiceExt<T> + 'a>,
9254 S: ::std::marker::Send,
9255 T: ::fbthrift::Transport,
9256 {
9257 fn transLeader_with_rpc_opts(
9258 &self,
9259 arg_req: &crate::types::TransLeaderReq,
9260 rpc_options: T::RpcOptions,
9261 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>> {
9262 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).transLeader_with_rpc_opts(
9263 arg_req,
9264 rpc_options,
9265 )
9266 }
9267 fn addPart_with_rpc_opts(
9268 &self,
9269 arg_req: &crate::types::AddPartReq,
9270 rpc_options: T::RpcOptions,
9271 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>> {
9272 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).addPart_with_rpc_opts(
9273 arg_req,
9274 rpc_options,
9275 )
9276 }
9277 fn addLearner_with_rpc_opts(
9278 &self,
9279 arg_req: &crate::types::AddLearnerReq,
9280 rpc_options: T::RpcOptions,
9281 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>> {
9282 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).addLearner_with_rpc_opts(
9283 arg_req,
9284 rpc_options,
9285 )
9286 }
9287 fn removePart_with_rpc_opts(
9288 &self,
9289 arg_req: &crate::types::RemovePartReq,
9290 rpc_options: T::RpcOptions,
9291 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>> {
9292 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).removePart_with_rpc_opts(
9293 arg_req,
9294 rpc_options,
9295 )
9296 }
9297 fn memberChange_with_rpc_opts(
9298 &self,
9299 arg_req: &crate::types::MemberChangeReq,
9300 rpc_options: T::RpcOptions,
9301 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>> {
9302 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).memberChange_with_rpc_opts(
9303 arg_req,
9304 rpc_options,
9305 )
9306 }
9307 fn waitingForCatchUpData_with_rpc_opts(
9308 &self,
9309 arg_req: &crate::types::CatchUpDataReq,
9310 rpc_options: T::RpcOptions,
9311 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>> {
9312 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).waitingForCatchUpData_with_rpc_opts(
9313 arg_req,
9314 rpc_options,
9315 )
9316 }
9317 fn createCheckpoint_with_rpc_opts(
9318 &self,
9319 arg_req: &crate::types::CreateCPRequest,
9320 rpc_options: T::RpcOptions,
9321 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>> {
9322 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).createCheckpoint_with_rpc_opts(
9323 arg_req,
9324 rpc_options,
9325 )
9326 }
9327 fn dropCheckpoint_with_rpc_opts(
9328 &self,
9329 arg_req: &crate::types::DropCPRequest,
9330 rpc_options: T::RpcOptions,
9331 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>> {
9332 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).dropCheckpoint_with_rpc_opts(
9333 arg_req,
9334 rpc_options,
9335 )
9336 }
9337 fn blockingWrites_with_rpc_opts(
9338 &self,
9339 arg_req: &crate::types::BlockingSignRequest,
9340 rpc_options: T::RpcOptions,
9341 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>> {
9342 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).blockingWrites_with_rpc_opts(
9343 arg_req,
9344 rpc_options,
9345 )
9346 }
9347 fn getLeaderParts_with_rpc_opts(
9348 &self,
9349 arg_req: &crate::types::GetLeaderReq,
9350 rpc_options: T::RpcOptions,
9351 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>> {
9352 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).getLeaderParts_with_rpc_opts(
9353 arg_req,
9354 rpc_options,
9355 )
9356 }
9357 fn checkPeers_with_rpc_opts(
9358 &self,
9359 arg_req: &crate::types::CheckPeersReq,
9360 rpc_options: T::RpcOptions,
9361 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>> {
9362 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).checkPeers_with_rpc_opts(
9363 arg_req,
9364 rpc_options,
9365 )
9366 }
9367 fn addAdminTask_with_rpc_opts(
9368 &self,
9369 arg_req: &crate::types::AddTaskRequest,
9370 rpc_options: T::RpcOptions,
9371 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>> {
9372 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).addAdminTask_with_rpc_opts(
9373 arg_req,
9374 rpc_options,
9375 )
9376 }
9377 fn stopAdminTask_with_rpc_opts(
9378 &self,
9379 arg_req: &crate::types::StopTaskRequest,
9380 rpc_options: T::RpcOptions,
9381 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>> {
9382 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).stopAdminTask_with_rpc_opts(
9383 arg_req,
9384 rpc_options,
9385 )
9386 }
9387 fn clearSpace_with_rpc_opts(
9388 &self,
9389 arg_req: &crate::types::ClearSpaceReq,
9390 rpc_options: T::RpcOptions,
9391 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>> {
9392 <Self as ::std::convert::AsRef<dyn StorageAdminServiceExt<T>>>::as_ref(self).clearSpace_with_rpc_opts(
9393 arg_req,
9394 rpc_options,
9395 )
9396 }
9397 }
9398
9399 #[derive(Clone)]
9400 pub struct make_StorageAdminService;
9401
9402 impl dyn StorageAdminService {
9416 pub fn new<P, T>(
9417 protocol: P,
9418 transport: T,
9419 ) -> ::std::sync::Arc<impl StorageAdminService + ::std::marker::Send + ::std::marker::Sync + 'static>
9420 where
9421 P: ::fbthrift::Protocol<Frame = T>,
9422 T: ::fbthrift::Transport,
9423 P::Deserializer: ::std::marker::Send,
9424 {
9425 let spawner = ::fbthrift::help::NoopSpawner;
9426 Self::with_spawner(protocol, transport, spawner)
9427 }
9428
9429 pub fn with_spawner<P, T, S>(
9430 protocol: P,
9431 transport: T,
9432 spawner: S,
9433 ) -> ::std::sync::Arc<impl StorageAdminService + ::std::marker::Send + ::std::marker::Sync + 'static>
9434 where
9435 P: ::fbthrift::Protocol<Frame = T>,
9436 T: ::fbthrift::Transport,
9437 P::Deserializer: ::std::marker::Send,
9438 S: ::fbthrift::help::Spawner,
9439 {
9440 let _ = protocol;
9441 let _ = spawner;
9442 ::std::sync::Arc::new(StorageAdminServiceImpl::<P, T, S>::new(transport))
9443 }
9444 }
9445
9446 impl<T> dyn StorageAdminServiceExt<T>
9447 where
9448 T: ::fbthrift::Transport,
9449 {
9450 pub fn new<P>(
9451 protocol: P,
9452 transport: T,
9453 ) -> ::std::sync::Arc<impl StorageAdminServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
9454 where
9455 P: ::fbthrift::Protocol<Frame = T>,
9456 P::Deserializer: ::std::marker::Send,
9457 {
9458 let spawner = ::fbthrift::help::NoopSpawner;
9459 Self::with_spawner(protocol, transport, spawner)
9460 }
9461
9462 pub fn with_spawner<P, S>(
9463 protocol: P,
9464 transport: T,
9465 spawner: S,
9466 ) -> ::std::sync::Arc<impl StorageAdminServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
9467 where
9468 P: ::fbthrift::Protocol<Frame = T>,
9469 P::Deserializer: ::std::marker::Send,
9470 S: ::fbthrift::help::Spawner,
9471 {
9472 let _ = protocol;
9473 let _ = spawner;
9474 ::std::sync::Arc::new(StorageAdminServiceImpl::<P, T, S>::new(transport))
9475 }
9476 }
9477
9478 pub type StorageAdminServiceDynClient = <make_StorageAdminService as ::fbthrift::ClientFactory>::Api;
9479 pub type StorageAdminServiceClient = ::std::sync::Arc<StorageAdminServiceDynClient>;
9480
9481 impl ::fbthrift::ClientFactory for make_StorageAdminService {
9484 type Api = dyn StorageAdminService + ::std::marker::Send + ::std::marker::Sync + 'static;
9485
9486 fn with_spawner<P, T, S>(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc<Self::Api>
9487 where
9488 P: ::fbthrift::Protocol<Frame = T>,
9489 T: ::fbthrift::Transport,
9490 P::Deserializer: ::std::marker::Send,
9491 S: ::fbthrift::help::Spawner,
9492 {
9493 <dyn StorageAdminService>::with_spawner(protocol, transport, spawner)
9494 }
9495 }
9496
9497
9498 pub struct InternalStorageServiceImpl<P, T, S = ::fbthrift::NoopSpawner> {
9499 transport: T,
9500 _phantom: ::std::marker::PhantomData<fn() -> (P, S)>,
9501 }
9502
9503 impl<P, T, S> InternalStorageServiceImpl<P, T, S>
9504 where
9505 P: ::fbthrift::Protocol,
9506 T: ::fbthrift::Transport,
9507 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
9508 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
9509 P::Deserializer: ::std::marker::Send,
9510 S: ::fbthrift::help::Spawner,
9511 {
9512 pub fn new(
9513 transport: T,
9514 ) -> Self {
9515 Self {
9516 transport,
9517 _phantom: ::std::marker::PhantomData,
9518 }
9519 }
9520
9521 pub fn transport(&self) -> &T {
9522 &self.transport
9523 }
9524
9525
9526 fn _chainAddEdges_impl(
9527 &self,
9528 arg_req: &crate::types::ChainAddEdgesRequest,
9529 rpc_options: T::RpcOptions,
9530 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>> {
9531 use ::const_cstr::const_cstr;
9532 use ::tracing::Instrument as _;
9533 use ::futures::FutureExt as _;
9534
9535 const_cstr! {
9536 SERVICE_NAME = "InternalStorageService";
9537 METHOD_NAME = "InternalStorageService.chainAddEdges";
9538 }
9539 let args = self::Args_InternalStorageService_chainAddEdges {
9540 req: arg_req,
9541 _phantom: ::std::marker::PhantomData,
9542 };
9543
9544 let transport = self.transport();
9545
9546 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("chainAddEdges", &args) {
9548 ::std::result::Result::Ok(res) => res,
9549 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
9550 };
9551
9552 let call = transport
9553 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
9554 .instrument(::tracing::trace_span!("call", function = "InternalStorageService.chainAddEdges"));
9555
9556 async move {
9557 let reply_env = call.await?;
9558
9559 let de = P::deserializer(reply_env);
9560 let (res, _de): (::std::result::Result<crate::services::internal_storage_service::ChainAddEdgesExn, _>, _) =
9561 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
9562
9563 let res = match res {
9564 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
9565 ::std::result::Result::Err(aexn) =>
9566 ::std::result::Result::Err(crate::errors::internal_storage_service::ChainAddEdgesError::ApplicationException(aexn))
9567 };
9568 res
9569 }
9570 .instrument(::tracing::info_span!("InternalStorageService.chainAddEdges"))
9571 .boxed()
9572 }
9573
9574 fn _chainUpdateEdge_impl(
9575 &self,
9576 arg_req: &crate::types::ChainUpdateEdgeRequest,
9577 rpc_options: T::RpcOptions,
9578 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>> {
9579 use ::const_cstr::const_cstr;
9580 use ::tracing::Instrument as _;
9581 use ::futures::FutureExt as _;
9582
9583 const_cstr! {
9584 SERVICE_NAME = "InternalStorageService";
9585 METHOD_NAME = "InternalStorageService.chainUpdateEdge";
9586 }
9587 let args = self::Args_InternalStorageService_chainUpdateEdge {
9588 req: arg_req,
9589 _phantom: ::std::marker::PhantomData,
9590 };
9591
9592 let transport = self.transport();
9593
9594 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("chainUpdateEdge", &args) {
9596 ::std::result::Result::Ok(res) => res,
9597 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
9598 };
9599
9600 let call = transport
9601 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
9602 .instrument(::tracing::trace_span!("call", function = "InternalStorageService.chainUpdateEdge"));
9603
9604 async move {
9605 let reply_env = call.await?;
9606
9607 let de = P::deserializer(reply_env);
9608 let (res, _de): (::std::result::Result<crate::services::internal_storage_service::ChainUpdateEdgeExn, _>, _) =
9609 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
9610
9611 let res = match res {
9612 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
9613 ::std::result::Result::Err(aexn) =>
9614 ::std::result::Result::Err(crate::errors::internal_storage_service::ChainUpdateEdgeError::ApplicationException(aexn))
9615 };
9616 res
9617 }
9618 .instrument(::tracing::info_span!("InternalStorageService.chainUpdateEdge"))
9619 .boxed()
9620 }
9621
9622 fn _chainDeleteEdges_impl(
9623 &self,
9624 arg_req: &crate::types::ChainDeleteEdgesRequest,
9625 rpc_options: T::RpcOptions,
9626 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>> {
9627 use ::const_cstr::const_cstr;
9628 use ::tracing::Instrument as _;
9629 use ::futures::FutureExt as _;
9630
9631 const_cstr! {
9632 SERVICE_NAME = "InternalStorageService";
9633 METHOD_NAME = "InternalStorageService.chainDeleteEdges";
9634 }
9635 let args = self::Args_InternalStorageService_chainDeleteEdges {
9636 req: arg_req,
9637 _phantom: ::std::marker::PhantomData,
9638 };
9639
9640 let transport = self.transport();
9641
9642 let request_env = match ::fbthrift::help::serialize_request_envelope::<P, _>("chainDeleteEdges", &args) {
9644 ::std::result::Result::Ok(res) => res,
9645 ::std::result::Result::Err(err) => return ::futures::future::err(err.into()).boxed(),
9646 };
9647
9648 let call = transport
9649 .call(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr(), request_env, rpc_options)
9650 .instrument(::tracing::trace_span!("call", function = "InternalStorageService.chainDeleteEdges"));
9651
9652 async move {
9653 let reply_env = call.await?;
9654
9655 let de = P::deserializer(reply_env);
9656 let (res, _de): (::std::result::Result<crate::services::internal_storage_service::ChainDeleteEdgesExn, _>, _) =
9657 ::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de).await?;
9658
9659 let res = match res {
9660 ::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
9661 ::std::result::Result::Err(aexn) =>
9662 ::std::result::Result::Err(crate::errors::internal_storage_service::ChainDeleteEdgesError::ApplicationException(aexn))
9663 };
9664 res
9665 }
9666 .instrument(::tracing::info_span!("InternalStorageService.chainDeleteEdges"))
9667 .boxed()
9668 }
9669 }
9670
9671 pub trait InternalStorageService: ::std::marker::Send {
9672 fn chainAddEdges(
9673 &self,
9674 arg_req: &crate::types::ChainAddEdgesRequest,
9675 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>>;
9676
9677 fn chainUpdateEdge(
9678 &self,
9679 arg_req: &crate::types::ChainUpdateEdgeRequest,
9680 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>>;
9681
9682 fn chainDeleteEdges(
9683 &self,
9684 arg_req: &crate::types::ChainDeleteEdgesRequest,
9685 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>>;
9686 }
9687
9688 pub trait InternalStorageServiceExt<T>: InternalStorageService
9689 where
9690 T: ::fbthrift::Transport,
9691 {
9692 fn chainAddEdges_with_rpc_opts(
9693 &self,
9694 arg_req: &crate::types::ChainAddEdgesRequest,
9695 rpc_options: T::RpcOptions,
9696 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>>;
9697 fn chainUpdateEdge_with_rpc_opts(
9698 &self,
9699 arg_req: &crate::types::ChainUpdateEdgeRequest,
9700 rpc_options: T::RpcOptions,
9701 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>>;
9702 fn chainDeleteEdges_with_rpc_opts(
9703 &self,
9704 arg_req: &crate::types::ChainDeleteEdgesRequest,
9705 rpc_options: T::RpcOptions,
9706 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>>;
9707 }
9708
9709 struct Args_InternalStorageService_chainAddEdges<'a> {
9710 req: &'a crate::types::ChainAddEdgesRequest,
9711 _phantom: ::std::marker::PhantomData<&'a ()>,
9712 }
9713
9714 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_InternalStorageService_chainAddEdges<'a> {
9715 #[inline]
9716 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "InternalStorageService.chainAddEdges"))]
9717 fn write(&self, p: &mut P) {
9718 p.write_struct_begin("args");
9719 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
9720 ::fbthrift::Serialize::write(&self.req, p);
9721 p.write_field_end();
9722 p.write_field_stop();
9723 p.write_struct_end();
9724 }
9725 }
9726
9727 struct Args_InternalStorageService_chainUpdateEdge<'a> {
9728 req: &'a crate::types::ChainUpdateEdgeRequest,
9729 _phantom: ::std::marker::PhantomData<&'a ()>,
9730 }
9731
9732 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_InternalStorageService_chainUpdateEdge<'a> {
9733 #[inline]
9734 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "InternalStorageService.chainUpdateEdge"))]
9735 fn write(&self, p: &mut P) {
9736 p.write_struct_begin("args");
9737 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
9738 ::fbthrift::Serialize::write(&self.req, p);
9739 p.write_field_end();
9740 p.write_field_stop();
9741 p.write_struct_end();
9742 }
9743 }
9744
9745 struct Args_InternalStorageService_chainDeleteEdges<'a> {
9746 req: &'a crate::types::ChainDeleteEdgesRequest,
9747 _phantom: ::std::marker::PhantomData<&'a ()>,
9748 }
9749
9750 impl<'a, P: ::fbthrift::ProtocolWriter> ::fbthrift::Serialize<P> for self::Args_InternalStorageService_chainDeleteEdges<'a> {
9751 #[inline]
9752 #[::tracing::instrument(skip_all, level = "trace", name = "serialize_args", fields(method = "InternalStorageService.chainDeleteEdges"))]
9753 fn write(&self, p: &mut P) {
9754 p.write_struct_begin("args");
9755 p.write_field_begin("req", ::fbthrift::TType::Struct, 1i16);
9756 ::fbthrift::Serialize::write(&self.req, p);
9757 p.write_field_end();
9758 p.write_field_stop();
9759 p.write_struct_end();
9760 }
9761 }
9762
9763 impl<P, T, S> InternalStorageService for InternalStorageServiceImpl<P, T, S>
9764 where
9765 P: ::fbthrift::Protocol,
9766 T: ::fbthrift::Transport,
9767 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
9768 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
9769 P::Deserializer: ::std::marker::Send,
9770 S: ::fbthrift::help::Spawner,
9771 {
9772 fn chainAddEdges(
9773 &self,
9774 arg_req: &crate::types::ChainAddEdgesRequest,
9775 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>> {
9776 let rpc_options = T::RpcOptions::default();
9777 self._chainAddEdges_impl(
9778 arg_req,
9779 rpc_options,
9780 )
9781 }
9782 fn chainUpdateEdge(
9783 &self,
9784 arg_req: &crate::types::ChainUpdateEdgeRequest,
9785 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>> {
9786 let rpc_options = T::RpcOptions::default();
9787 self._chainUpdateEdge_impl(
9788 arg_req,
9789 rpc_options,
9790 )
9791 }
9792 fn chainDeleteEdges(
9793 &self,
9794 arg_req: &crate::types::ChainDeleteEdgesRequest,
9795 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>> {
9796 let rpc_options = T::RpcOptions::default();
9797 self._chainDeleteEdges_impl(
9798 arg_req,
9799 rpc_options,
9800 )
9801 }
9802 }
9803
9804 impl<P, T, S> InternalStorageServiceExt<T> for InternalStorageServiceImpl<P, T, S>
9805 where
9806 P: ::fbthrift::Protocol,
9807 T: ::fbthrift::Transport,
9808 P::Frame: ::fbthrift::Framing<DecBuf = ::fbthrift::FramingDecoded<T>>,
9809 ::fbthrift::ProtocolEncoded<P>: ::fbthrift::BufMutExt<Final = ::fbthrift::FramingEncodedFinal<T>>,
9810 P::Deserializer: ::std::marker::Send,
9811 S: ::fbthrift::help::Spawner,
9812 {
9813 fn chainAddEdges_with_rpc_opts(
9814 &self,
9815 arg_req: &crate::types::ChainAddEdgesRequest,
9816 rpc_options: T::RpcOptions,
9817 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>> {
9818 self._chainAddEdges_impl(
9819 arg_req,
9820 rpc_options,
9821 )
9822 }
9823 fn chainUpdateEdge_with_rpc_opts(
9824 &self,
9825 arg_req: &crate::types::ChainUpdateEdgeRequest,
9826 rpc_options: T::RpcOptions,
9827 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>> {
9828 self._chainUpdateEdge_impl(
9829 arg_req,
9830 rpc_options,
9831 )
9832 }
9833 fn chainDeleteEdges_with_rpc_opts(
9834 &self,
9835 arg_req: &crate::types::ChainDeleteEdgesRequest,
9836 rpc_options: T::RpcOptions,
9837 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>> {
9838 self._chainDeleteEdges_impl(
9839 arg_req,
9840 rpc_options,
9841 )
9842 }
9843 }
9844
9845 impl<'a, S> InternalStorageService for S
9846 where
9847 S: ::std::convert::AsRef<dyn InternalStorageService + 'a>,
9848 S: ::std::marker::Send,
9849 {
9850 fn chainAddEdges(
9851 &self,
9852 arg_req: &crate::types::ChainAddEdgesRequest,
9853 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>> {
9854 self.as_ref().chainAddEdges(
9855 arg_req,
9856 )
9857 }
9858 fn chainUpdateEdge(
9859 &self,
9860 arg_req: &crate::types::ChainUpdateEdgeRequest,
9861 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>> {
9862 self.as_ref().chainUpdateEdge(
9863 arg_req,
9864 )
9865 }
9866 fn chainDeleteEdges(
9867 &self,
9868 arg_req: &crate::types::ChainDeleteEdgesRequest,
9869 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>> {
9870 self.as_ref().chainDeleteEdges(
9871 arg_req,
9872 )
9873 }
9874 }
9875
9876 impl<'a, S, T> InternalStorageServiceExt<T> for S
9877 where
9878 S: ::std::convert::AsRef<dyn InternalStorageService + 'a>,
9879 S: ::std::convert::AsRef<dyn InternalStorageServiceExt<T> + 'a>,
9880 S: ::std::marker::Send,
9881 T: ::fbthrift::Transport,
9882 {
9883 fn chainAddEdges_with_rpc_opts(
9884 &self,
9885 arg_req: &crate::types::ChainAddEdgesRequest,
9886 rpc_options: T::RpcOptions,
9887 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>> {
9888 <Self as ::std::convert::AsRef<dyn InternalStorageServiceExt<T>>>::as_ref(self).chainAddEdges_with_rpc_opts(
9889 arg_req,
9890 rpc_options,
9891 )
9892 }
9893 fn chainUpdateEdge_with_rpc_opts(
9894 &self,
9895 arg_req: &crate::types::ChainUpdateEdgeRequest,
9896 rpc_options: T::RpcOptions,
9897 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>> {
9898 <Self as ::std::convert::AsRef<dyn InternalStorageServiceExt<T>>>::as_ref(self).chainUpdateEdge_with_rpc_opts(
9899 arg_req,
9900 rpc_options,
9901 )
9902 }
9903 fn chainDeleteEdges_with_rpc_opts(
9904 &self,
9905 arg_req: &crate::types::ChainDeleteEdgesRequest,
9906 rpc_options: T::RpcOptions,
9907 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>> {
9908 <Self as ::std::convert::AsRef<dyn InternalStorageServiceExt<T>>>::as_ref(self).chainDeleteEdges_with_rpc_opts(
9909 arg_req,
9910 rpc_options,
9911 )
9912 }
9913 }
9914
9915 #[derive(Clone)]
9916 pub struct make_InternalStorageService;
9917
9918 impl dyn InternalStorageService {
9932 pub fn new<P, T>(
9933 protocol: P,
9934 transport: T,
9935 ) -> ::std::sync::Arc<impl InternalStorageService + ::std::marker::Send + ::std::marker::Sync + 'static>
9936 where
9937 P: ::fbthrift::Protocol<Frame = T>,
9938 T: ::fbthrift::Transport,
9939 P::Deserializer: ::std::marker::Send,
9940 {
9941 let spawner = ::fbthrift::help::NoopSpawner;
9942 Self::with_spawner(protocol, transport, spawner)
9943 }
9944
9945 pub fn with_spawner<P, T, S>(
9946 protocol: P,
9947 transport: T,
9948 spawner: S,
9949 ) -> ::std::sync::Arc<impl InternalStorageService + ::std::marker::Send + ::std::marker::Sync + 'static>
9950 where
9951 P: ::fbthrift::Protocol<Frame = T>,
9952 T: ::fbthrift::Transport,
9953 P::Deserializer: ::std::marker::Send,
9954 S: ::fbthrift::help::Spawner,
9955 {
9956 let _ = protocol;
9957 let _ = spawner;
9958 ::std::sync::Arc::new(InternalStorageServiceImpl::<P, T, S>::new(transport))
9959 }
9960 }
9961
9962 impl<T> dyn InternalStorageServiceExt<T>
9963 where
9964 T: ::fbthrift::Transport,
9965 {
9966 pub fn new<P>(
9967 protocol: P,
9968 transport: T,
9969 ) -> ::std::sync::Arc<impl InternalStorageServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
9970 where
9971 P: ::fbthrift::Protocol<Frame = T>,
9972 P::Deserializer: ::std::marker::Send,
9973 {
9974 let spawner = ::fbthrift::help::NoopSpawner;
9975 Self::with_spawner(protocol, transport, spawner)
9976 }
9977
9978 pub fn with_spawner<P, S>(
9979 protocol: P,
9980 transport: T,
9981 spawner: S,
9982 ) -> ::std::sync::Arc<impl InternalStorageServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static>
9983 where
9984 P: ::fbthrift::Protocol<Frame = T>,
9985 P::Deserializer: ::std::marker::Send,
9986 S: ::fbthrift::help::Spawner,
9987 {
9988 let _ = protocol;
9989 let _ = spawner;
9990 ::std::sync::Arc::new(InternalStorageServiceImpl::<P, T, S>::new(transport))
9991 }
9992 }
9993
9994 pub type InternalStorageServiceDynClient = <make_InternalStorageService as ::fbthrift::ClientFactory>::Api;
9995 pub type InternalStorageServiceClient = ::std::sync::Arc<InternalStorageServiceDynClient>;
9996
9997 impl ::fbthrift::ClientFactory for make_InternalStorageService {
10000 type Api = dyn InternalStorageService + ::std::marker::Send + ::std::marker::Sync + 'static;
10001
10002 fn with_spawner<P, T, S>(protocol: P, transport: T, spawner: S) -> ::std::sync::Arc<Self::Api>
10003 where
10004 P: ::fbthrift::Protocol<Frame = T>,
10005 T: ::fbthrift::Transport,
10006 P::Deserializer: ::std::marker::Send,
10007 S: ::fbthrift::help::Spawner,
10008 {
10009 <dyn InternalStorageService>::with_spawner(protocol, transport, spawner)
10010 }
10011 }
10012
10013}
10014
10015pub mod server {
10017 #[::async_trait::async_trait]
10018 pub trait GraphStorageService: ::std::marker::Send + ::std::marker::Sync + 'static {
10019 async fn getNeighbors(
10020 &self,
10021 _req: crate::types::GetNeighborsRequest,
10022 ) -> ::std::result::Result<crate::types::GetNeighborsResponse, crate::services::graph_storage_service::GetNeighborsExn> {
10023 ::std::result::Result::Err(crate::services::graph_storage_service::GetNeighborsExn::ApplicationException(
10024 ::fbthrift::ApplicationException::unimplemented_method(
10025 "GraphStorageService",
10026 "getNeighbors",
10027 ),
10028 ))
10029 }
10030 async fn getDstBySrc(
10031 &self,
10032 _req: crate::types::GetDstBySrcRequest,
10033 ) -> ::std::result::Result<crate::types::GetDstBySrcResponse, crate::services::graph_storage_service::GetDstBySrcExn> {
10034 ::std::result::Result::Err(crate::services::graph_storage_service::GetDstBySrcExn::ApplicationException(
10035 ::fbthrift::ApplicationException::unimplemented_method(
10036 "GraphStorageService",
10037 "getDstBySrc",
10038 ),
10039 ))
10040 }
10041 async fn getProps(
10042 &self,
10043 _req: crate::types::GetPropRequest,
10044 ) -> ::std::result::Result<crate::types::GetPropResponse, crate::services::graph_storage_service::GetPropsExn> {
10045 ::std::result::Result::Err(crate::services::graph_storage_service::GetPropsExn::ApplicationException(
10046 ::fbthrift::ApplicationException::unimplemented_method(
10047 "GraphStorageService",
10048 "getProps",
10049 ),
10050 ))
10051 }
10052 async fn addVertices(
10053 &self,
10054 _req: crate::types::AddVerticesRequest,
10055 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::AddVerticesExn> {
10056 ::std::result::Result::Err(crate::services::graph_storage_service::AddVerticesExn::ApplicationException(
10057 ::fbthrift::ApplicationException::unimplemented_method(
10058 "GraphStorageService",
10059 "addVertices",
10060 ),
10061 ))
10062 }
10063 async fn addEdges(
10064 &self,
10065 _req: crate::types::AddEdgesRequest,
10066 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::AddEdgesExn> {
10067 ::std::result::Result::Err(crate::services::graph_storage_service::AddEdgesExn::ApplicationException(
10068 ::fbthrift::ApplicationException::unimplemented_method(
10069 "GraphStorageService",
10070 "addEdges",
10071 ),
10072 ))
10073 }
10074 async fn deleteEdges(
10075 &self,
10076 _req: crate::types::DeleteEdgesRequest,
10077 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::DeleteEdgesExn> {
10078 ::std::result::Result::Err(crate::services::graph_storage_service::DeleteEdgesExn::ApplicationException(
10079 ::fbthrift::ApplicationException::unimplemented_method(
10080 "GraphStorageService",
10081 "deleteEdges",
10082 ),
10083 ))
10084 }
10085 async fn deleteVertices(
10086 &self,
10087 _req: crate::types::DeleteVerticesRequest,
10088 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::DeleteVerticesExn> {
10089 ::std::result::Result::Err(crate::services::graph_storage_service::DeleteVerticesExn::ApplicationException(
10090 ::fbthrift::ApplicationException::unimplemented_method(
10091 "GraphStorageService",
10092 "deleteVertices",
10093 ),
10094 ))
10095 }
10096 async fn deleteTags(
10097 &self,
10098 _req: crate::types::DeleteTagsRequest,
10099 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::DeleteTagsExn> {
10100 ::std::result::Result::Err(crate::services::graph_storage_service::DeleteTagsExn::ApplicationException(
10101 ::fbthrift::ApplicationException::unimplemented_method(
10102 "GraphStorageService",
10103 "deleteTags",
10104 ),
10105 ))
10106 }
10107 async fn updateVertex(
10108 &self,
10109 _req: crate::types::UpdateVertexRequest,
10110 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::graph_storage_service::UpdateVertexExn> {
10111 ::std::result::Result::Err(crate::services::graph_storage_service::UpdateVertexExn::ApplicationException(
10112 ::fbthrift::ApplicationException::unimplemented_method(
10113 "GraphStorageService",
10114 "updateVertex",
10115 ),
10116 ))
10117 }
10118 async fn updateEdge(
10119 &self,
10120 _req: crate::types::UpdateEdgeRequest,
10121 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::graph_storage_service::UpdateEdgeExn> {
10122 ::std::result::Result::Err(crate::services::graph_storage_service::UpdateEdgeExn::ApplicationException(
10123 ::fbthrift::ApplicationException::unimplemented_method(
10124 "GraphStorageService",
10125 "updateEdge",
10126 ),
10127 ))
10128 }
10129 async fn scanVertex(
10130 &self,
10131 _req: crate::types::ScanVertexRequest,
10132 ) -> ::std::result::Result<crate::types::ScanResponse, crate::services::graph_storage_service::ScanVertexExn> {
10133 ::std::result::Result::Err(crate::services::graph_storage_service::ScanVertexExn::ApplicationException(
10134 ::fbthrift::ApplicationException::unimplemented_method(
10135 "GraphStorageService",
10136 "scanVertex",
10137 ),
10138 ))
10139 }
10140 async fn scanEdge(
10141 &self,
10142 _req: crate::types::ScanEdgeRequest,
10143 ) -> ::std::result::Result<crate::types::ScanResponse, crate::services::graph_storage_service::ScanEdgeExn> {
10144 ::std::result::Result::Err(crate::services::graph_storage_service::ScanEdgeExn::ApplicationException(
10145 ::fbthrift::ApplicationException::unimplemented_method(
10146 "GraphStorageService",
10147 "scanEdge",
10148 ),
10149 ))
10150 }
10151 async fn getUUID(
10152 &self,
10153 _req: crate::types::GetUUIDReq,
10154 ) -> ::std::result::Result<crate::types::GetUUIDResp, crate::services::graph_storage_service::GetUUIDExn> {
10155 ::std::result::Result::Err(crate::services::graph_storage_service::GetUUIDExn::ApplicationException(
10156 ::fbthrift::ApplicationException::unimplemented_method(
10157 "GraphStorageService",
10158 "getUUID",
10159 ),
10160 ))
10161 }
10162 async fn lookupIndex(
10163 &self,
10164 _req: crate::types::LookupIndexRequest,
10165 ) -> ::std::result::Result<crate::types::LookupIndexResp, crate::services::graph_storage_service::LookupIndexExn> {
10166 ::std::result::Result::Err(crate::services::graph_storage_service::LookupIndexExn::ApplicationException(
10167 ::fbthrift::ApplicationException::unimplemented_method(
10168 "GraphStorageService",
10169 "lookupIndex",
10170 ),
10171 ))
10172 }
10173 async fn lookupAndTraverse(
10174 &self,
10175 _req: crate::types::LookupAndTraverseRequest,
10176 ) -> ::std::result::Result<crate::types::GetNeighborsResponse, crate::services::graph_storage_service::LookupAndTraverseExn> {
10177 ::std::result::Result::Err(crate::services::graph_storage_service::LookupAndTraverseExn::ApplicationException(
10178 ::fbthrift::ApplicationException::unimplemented_method(
10179 "GraphStorageService",
10180 "lookupAndTraverse",
10181 ),
10182 ))
10183 }
10184 async fn chainUpdateEdge(
10185 &self,
10186 _req: crate::types::UpdateEdgeRequest,
10187 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::graph_storage_service::ChainUpdateEdgeExn> {
10188 ::std::result::Result::Err(crate::services::graph_storage_service::ChainUpdateEdgeExn::ApplicationException(
10189 ::fbthrift::ApplicationException::unimplemented_method(
10190 "GraphStorageService",
10191 "chainUpdateEdge",
10192 ),
10193 ))
10194 }
10195 async fn chainAddEdges(
10196 &self,
10197 _req: crate::types::AddEdgesRequest,
10198 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::ChainAddEdgesExn> {
10199 ::std::result::Result::Err(crate::services::graph_storage_service::ChainAddEdgesExn::ApplicationException(
10200 ::fbthrift::ApplicationException::unimplemented_method(
10201 "GraphStorageService",
10202 "chainAddEdges",
10203 ),
10204 ))
10205 }
10206 async fn chainDeleteEdges(
10207 &self,
10208 _req: crate::types::DeleteEdgesRequest,
10209 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::ChainDeleteEdgesExn> {
10210 ::std::result::Result::Err(crate::services::graph_storage_service::ChainDeleteEdgesExn::ApplicationException(
10211 ::fbthrift::ApplicationException::unimplemented_method(
10212 "GraphStorageService",
10213 "chainDeleteEdges",
10214 ),
10215 ))
10216 }
10217 async fn get(
10218 &self,
10219 _req: crate::types::KVGetRequest,
10220 ) -> ::std::result::Result<crate::types::KVGetResponse, crate::services::graph_storage_service::GetExn> {
10221 ::std::result::Result::Err(crate::services::graph_storage_service::GetExn::ApplicationException(
10222 ::fbthrift::ApplicationException::unimplemented_method(
10223 "GraphStorageService",
10224 "get",
10225 ),
10226 ))
10227 }
10228 async fn put(
10229 &self,
10230 _req: crate::types::KVPutRequest,
10231 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::PutExn> {
10232 ::std::result::Result::Err(crate::services::graph_storage_service::PutExn::ApplicationException(
10233 ::fbthrift::ApplicationException::unimplemented_method(
10234 "GraphStorageService",
10235 "put",
10236 ),
10237 ))
10238 }
10239 async fn remove(
10240 &self,
10241 _req: crate::types::KVRemoveRequest,
10242 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::RemoveExn> {
10243 ::std::result::Result::Err(crate::services::graph_storage_service::RemoveExn::ApplicationException(
10244 ::fbthrift::ApplicationException::unimplemented_method(
10245 "GraphStorageService",
10246 "remove",
10247 ),
10248 ))
10249 }
10250 }
10251
10252 #[::async_trait::async_trait]
10253 impl<T> GraphStorageService for ::std::boxed::Box<T>
10254 where
10255 T: GraphStorageService + Send + Sync + ?Sized,
10256 {
10257 async fn getNeighbors(
10258 &self,
10259 req: crate::types::GetNeighborsRequest,
10260 ) -> ::std::result::Result<crate::types::GetNeighborsResponse, crate::services::graph_storage_service::GetNeighborsExn> {
10261 (**self).getNeighbors(
10262 req,
10263 ).await
10264 }
10265 async fn getDstBySrc(
10266 &self,
10267 req: crate::types::GetDstBySrcRequest,
10268 ) -> ::std::result::Result<crate::types::GetDstBySrcResponse, crate::services::graph_storage_service::GetDstBySrcExn> {
10269 (**self).getDstBySrc(
10270 req,
10271 ).await
10272 }
10273 async fn getProps(
10274 &self,
10275 req: crate::types::GetPropRequest,
10276 ) -> ::std::result::Result<crate::types::GetPropResponse, crate::services::graph_storage_service::GetPropsExn> {
10277 (**self).getProps(
10278 req,
10279 ).await
10280 }
10281 async fn addVertices(
10282 &self,
10283 req: crate::types::AddVerticesRequest,
10284 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::AddVerticesExn> {
10285 (**self).addVertices(
10286 req,
10287 ).await
10288 }
10289 async fn addEdges(
10290 &self,
10291 req: crate::types::AddEdgesRequest,
10292 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::AddEdgesExn> {
10293 (**self).addEdges(
10294 req,
10295 ).await
10296 }
10297 async fn deleteEdges(
10298 &self,
10299 req: crate::types::DeleteEdgesRequest,
10300 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::DeleteEdgesExn> {
10301 (**self).deleteEdges(
10302 req,
10303 ).await
10304 }
10305 async fn deleteVertices(
10306 &self,
10307 req: crate::types::DeleteVerticesRequest,
10308 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::DeleteVerticesExn> {
10309 (**self).deleteVertices(
10310 req,
10311 ).await
10312 }
10313 async fn deleteTags(
10314 &self,
10315 req: crate::types::DeleteTagsRequest,
10316 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::DeleteTagsExn> {
10317 (**self).deleteTags(
10318 req,
10319 ).await
10320 }
10321 async fn updateVertex(
10322 &self,
10323 req: crate::types::UpdateVertexRequest,
10324 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::graph_storage_service::UpdateVertexExn> {
10325 (**self).updateVertex(
10326 req,
10327 ).await
10328 }
10329 async fn updateEdge(
10330 &self,
10331 req: crate::types::UpdateEdgeRequest,
10332 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::graph_storage_service::UpdateEdgeExn> {
10333 (**self).updateEdge(
10334 req,
10335 ).await
10336 }
10337 async fn scanVertex(
10338 &self,
10339 req: crate::types::ScanVertexRequest,
10340 ) -> ::std::result::Result<crate::types::ScanResponse, crate::services::graph_storage_service::ScanVertexExn> {
10341 (**self).scanVertex(
10342 req,
10343 ).await
10344 }
10345 async fn scanEdge(
10346 &self,
10347 req: crate::types::ScanEdgeRequest,
10348 ) -> ::std::result::Result<crate::types::ScanResponse, crate::services::graph_storage_service::ScanEdgeExn> {
10349 (**self).scanEdge(
10350 req,
10351 ).await
10352 }
10353 async fn getUUID(
10354 &self,
10355 req: crate::types::GetUUIDReq,
10356 ) -> ::std::result::Result<crate::types::GetUUIDResp, crate::services::graph_storage_service::GetUUIDExn> {
10357 (**self).getUUID(
10358 req,
10359 ).await
10360 }
10361 async fn lookupIndex(
10362 &self,
10363 req: crate::types::LookupIndexRequest,
10364 ) -> ::std::result::Result<crate::types::LookupIndexResp, crate::services::graph_storage_service::LookupIndexExn> {
10365 (**self).lookupIndex(
10366 req,
10367 ).await
10368 }
10369 async fn lookupAndTraverse(
10370 &self,
10371 req: crate::types::LookupAndTraverseRequest,
10372 ) -> ::std::result::Result<crate::types::GetNeighborsResponse, crate::services::graph_storage_service::LookupAndTraverseExn> {
10373 (**self).lookupAndTraverse(
10374 req,
10375 ).await
10376 }
10377 async fn chainUpdateEdge(
10378 &self,
10379 req: crate::types::UpdateEdgeRequest,
10380 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::graph_storage_service::ChainUpdateEdgeExn> {
10381 (**self).chainUpdateEdge(
10382 req,
10383 ).await
10384 }
10385 async fn chainAddEdges(
10386 &self,
10387 req: crate::types::AddEdgesRequest,
10388 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::ChainAddEdgesExn> {
10389 (**self).chainAddEdges(
10390 req,
10391 ).await
10392 }
10393 async fn chainDeleteEdges(
10394 &self,
10395 req: crate::types::DeleteEdgesRequest,
10396 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::ChainDeleteEdgesExn> {
10397 (**self).chainDeleteEdges(
10398 req,
10399 ).await
10400 }
10401 async fn get(
10402 &self,
10403 req: crate::types::KVGetRequest,
10404 ) -> ::std::result::Result<crate::types::KVGetResponse, crate::services::graph_storage_service::GetExn> {
10405 (**self).get(
10406 req,
10407 ).await
10408 }
10409 async fn put(
10410 &self,
10411 req: crate::types::KVPutRequest,
10412 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::PutExn> {
10413 (**self).put(
10414 req,
10415 ).await
10416 }
10417 async fn remove(
10418 &self,
10419 req: crate::types::KVRemoveRequest,
10420 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::graph_storage_service::RemoveExn> {
10421 (**self).remove(
10422 req,
10423 ).await
10424 }
10425 }
10426
10427 #[derive(Clone, Debug)]
10429 pub struct GraphStorageServiceProcessor<P, H, R, RS> {
10430 service: H,
10431 supa: ::fbthrift::NullServiceProcessor<P, R, RS>,
10432 _phantom: ::std::marker::PhantomData<(P, H, R, RS)>,
10433 }
10434
10435 struct Args_GraphStorageService_getNeighbors {
10436 req: crate::types::GetNeighborsRequest,
10437 }
10438 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_getNeighbors {
10439 #[inline]
10440 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.getNeighbors"))]
10441 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10442 static ARGS: &[::fbthrift::Field] = &[
10443 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10444 ];
10445 let mut field_req = ::std::option::Option::None;
10446 let _ = p.read_struct_begin(|_| ())?;
10447 loop {
10448 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10449 match (fty, fid as ::std::primitive::i32) {
10450 (::fbthrift::TType::Stop, _) => break,
10451 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10452 (fty, _) => p.skip(fty)?,
10453 }
10454 p.read_field_end()?;
10455 }
10456 p.read_struct_end()?;
10457 ::std::result::Result::Ok(Self {
10458 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.getNeighbors", "req"))?,
10459 })
10460 }
10461 }
10462
10463 struct Args_GraphStorageService_getDstBySrc {
10464 req: crate::types::GetDstBySrcRequest,
10465 }
10466 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_getDstBySrc {
10467 #[inline]
10468 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.getDstBySrc"))]
10469 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10470 static ARGS: &[::fbthrift::Field] = &[
10471 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10472 ];
10473 let mut field_req = ::std::option::Option::None;
10474 let _ = p.read_struct_begin(|_| ())?;
10475 loop {
10476 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10477 match (fty, fid as ::std::primitive::i32) {
10478 (::fbthrift::TType::Stop, _) => break,
10479 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10480 (fty, _) => p.skip(fty)?,
10481 }
10482 p.read_field_end()?;
10483 }
10484 p.read_struct_end()?;
10485 ::std::result::Result::Ok(Self {
10486 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.getDstBySrc", "req"))?,
10487 })
10488 }
10489 }
10490
10491 struct Args_GraphStorageService_getProps {
10492 req: crate::types::GetPropRequest,
10493 }
10494 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_getProps {
10495 #[inline]
10496 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.getProps"))]
10497 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10498 static ARGS: &[::fbthrift::Field] = &[
10499 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10500 ];
10501 let mut field_req = ::std::option::Option::None;
10502 let _ = p.read_struct_begin(|_| ())?;
10503 loop {
10504 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10505 match (fty, fid as ::std::primitive::i32) {
10506 (::fbthrift::TType::Stop, _) => break,
10507 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10508 (fty, _) => p.skip(fty)?,
10509 }
10510 p.read_field_end()?;
10511 }
10512 p.read_struct_end()?;
10513 ::std::result::Result::Ok(Self {
10514 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.getProps", "req"))?,
10515 })
10516 }
10517 }
10518
10519 struct Args_GraphStorageService_addVertices {
10520 req: crate::types::AddVerticesRequest,
10521 }
10522 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_addVertices {
10523 #[inline]
10524 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.addVertices"))]
10525 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10526 static ARGS: &[::fbthrift::Field] = &[
10527 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10528 ];
10529 let mut field_req = ::std::option::Option::None;
10530 let _ = p.read_struct_begin(|_| ())?;
10531 loop {
10532 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10533 match (fty, fid as ::std::primitive::i32) {
10534 (::fbthrift::TType::Stop, _) => break,
10535 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10536 (fty, _) => p.skip(fty)?,
10537 }
10538 p.read_field_end()?;
10539 }
10540 p.read_struct_end()?;
10541 ::std::result::Result::Ok(Self {
10542 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.addVertices", "req"))?,
10543 })
10544 }
10545 }
10546
10547 struct Args_GraphStorageService_addEdges {
10548 req: crate::types::AddEdgesRequest,
10549 }
10550 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_addEdges {
10551 #[inline]
10552 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.addEdges"))]
10553 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10554 static ARGS: &[::fbthrift::Field] = &[
10555 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10556 ];
10557 let mut field_req = ::std::option::Option::None;
10558 let _ = p.read_struct_begin(|_| ())?;
10559 loop {
10560 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10561 match (fty, fid as ::std::primitive::i32) {
10562 (::fbthrift::TType::Stop, _) => break,
10563 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10564 (fty, _) => p.skip(fty)?,
10565 }
10566 p.read_field_end()?;
10567 }
10568 p.read_struct_end()?;
10569 ::std::result::Result::Ok(Self {
10570 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.addEdges", "req"))?,
10571 })
10572 }
10573 }
10574
10575 struct Args_GraphStorageService_deleteEdges {
10576 req: crate::types::DeleteEdgesRequest,
10577 }
10578 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_deleteEdges {
10579 #[inline]
10580 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.deleteEdges"))]
10581 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10582 static ARGS: &[::fbthrift::Field] = &[
10583 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10584 ];
10585 let mut field_req = ::std::option::Option::None;
10586 let _ = p.read_struct_begin(|_| ())?;
10587 loop {
10588 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10589 match (fty, fid as ::std::primitive::i32) {
10590 (::fbthrift::TType::Stop, _) => break,
10591 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10592 (fty, _) => p.skip(fty)?,
10593 }
10594 p.read_field_end()?;
10595 }
10596 p.read_struct_end()?;
10597 ::std::result::Result::Ok(Self {
10598 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.deleteEdges", "req"))?,
10599 })
10600 }
10601 }
10602
10603 struct Args_GraphStorageService_deleteVertices {
10604 req: crate::types::DeleteVerticesRequest,
10605 }
10606 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_deleteVertices {
10607 #[inline]
10608 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.deleteVertices"))]
10609 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10610 static ARGS: &[::fbthrift::Field] = &[
10611 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10612 ];
10613 let mut field_req = ::std::option::Option::None;
10614 let _ = p.read_struct_begin(|_| ())?;
10615 loop {
10616 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10617 match (fty, fid as ::std::primitive::i32) {
10618 (::fbthrift::TType::Stop, _) => break,
10619 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10620 (fty, _) => p.skip(fty)?,
10621 }
10622 p.read_field_end()?;
10623 }
10624 p.read_struct_end()?;
10625 ::std::result::Result::Ok(Self {
10626 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.deleteVertices", "req"))?,
10627 })
10628 }
10629 }
10630
10631 struct Args_GraphStorageService_deleteTags {
10632 req: crate::types::DeleteTagsRequest,
10633 }
10634 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_deleteTags {
10635 #[inline]
10636 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.deleteTags"))]
10637 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10638 static ARGS: &[::fbthrift::Field] = &[
10639 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10640 ];
10641 let mut field_req = ::std::option::Option::None;
10642 let _ = p.read_struct_begin(|_| ())?;
10643 loop {
10644 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10645 match (fty, fid as ::std::primitive::i32) {
10646 (::fbthrift::TType::Stop, _) => break,
10647 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10648 (fty, _) => p.skip(fty)?,
10649 }
10650 p.read_field_end()?;
10651 }
10652 p.read_struct_end()?;
10653 ::std::result::Result::Ok(Self {
10654 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.deleteTags", "req"))?,
10655 })
10656 }
10657 }
10658
10659 struct Args_GraphStorageService_updateVertex {
10660 req: crate::types::UpdateVertexRequest,
10661 }
10662 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_updateVertex {
10663 #[inline]
10664 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.updateVertex"))]
10665 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10666 static ARGS: &[::fbthrift::Field] = &[
10667 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10668 ];
10669 let mut field_req = ::std::option::Option::None;
10670 let _ = p.read_struct_begin(|_| ())?;
10671 loop {
10672 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10673 match (fty, fid as ::std::primitive::i32) {
10674 (::fbthrift::TType::Stop, _) => break,
10675 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10676 (fty, _) => p.skip(fty)?,
10677 }
10678 p.read_field_end()?;
10679 }
10680 p.read_struct_end()?;
10681 ::std::result::Result::Ok(Self {
10682 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.updateVertex", "req"))?,
10683 })
10684 }
10685 }
10686
10687 struct Args_GraphStorageService_updateEdge {
10688 req: crate::types::UpdateEdgeRequest,
10689 }
10690 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_updateEdge {
10691 #[inline]
10692 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.updateEdge"))]
10693 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10694 static ARGS: &[::fbthrift::Field] = &[
10695 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10696 ];
10697 let mut field_req = ::std::option::Option::None;
10698 let _ = p.read_struct_begin(|_| ())?;
10699 loop {
10700 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10701 match (fty, fid as ::std::primitive::i32) {
10702 (::fbthrift::TType::Stop, _) => break,
10703 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10704 (fty, _) => p.skip(fty)?,
10705 }
10706 p.read_field_end()?;
10707 }
10708 p.read_struct_end()?;
10709 ::std::result::Result::Ok(Self {
10710 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.updateEdge", "req"))?,
10711 })
10712 }
10713 }
10714
10715 struct Args_GraphStorageService_scanVertex {
10716 req: crate::types::ScanVertexRequest,
10717 }
10718 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_scanVertex {
10719 #[inline]
10720 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.scanVertex"))]
10721 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10722 static ARGS: &[::fbthrift::Field] = &[
10723 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10724 ];
10725 let mut field_req = ::std::option::Option::None;
10726 let _ = p.read_struct_begin(|_| ())?;
10727 loop {
10728 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10729 match (fty, fid as ::std::primitive::i32) {
10730 (::fbthrift::TType::Stop, _) => break,
10731 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10732 (fty, _) => p.skip(fty)?,
10733 }
10734 p.read_field_end()?;
10735 }
10736 p.read_struct_end()?;
10737 ::std::result::Result::Ok(Self {
10738 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.scanVertex", "req"))?,
10739 })
10740 }
10741 }
10742
10743 struct Args_GraphStorageService_scanEdge {
10744 req: crate::types::ScanEdgeRequest,
10745 }
10746 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_scanEdge {
10747 #[inline]
10748 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.scanEdge"))]
10749 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10750 static ARGS: &[::fbthrift::Field] = &[
10751 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10752 ];
10753 let mut field_req = ::std::option::Option::None;
10754 let _ = p.read_struct_begin(|_| ())?;
10755 loop {
10756 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10757 match (fty, fid as ::std::primitive::i32) {
10758 (::fbthrift::TType::Stop, _) => break,
10759 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10760 (fty, _) => p.skip(fty)?,
10761 }
10762 p.read_field_end()?;
10763 }
10764 p.read_struct_end()?;
10765 ::std::result::Result::Ok(Self {
10766 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.scanEdge", "req"))?,
10767 })
10768 }
10769 }
10770
10771 struct Args_GraphStorageService_getUUID {
10772 req: crate::types::GetUUIDReq,
10773 }
10774 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_getUUID {
10775 #[inline]
10776 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.getUUID"))]
10777 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10778 static ARGS: &[::fbthrift::Field] = &[
10779 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10780 ];
10781 let mut field_req = ::std::option::Option::None;
10782 let _ = p.read_struct_begin(|_| ())?;
10783 loop {
10784 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10785 match (fty, fid as ::std::primitive::i32) {
10786 (::fbthrift::TType::Stop, _) => break,
10787 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10788 (fty, _) => p.skip(fty)?,
10789 }
10790 p.read_field_end()?;
10791 }
10792 p.read_struct_end()?;
10793 ::std::result::Result::Ok(Self {
10794 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.getUUID", "req"))?,
10795 })
10796 }
10797 }
10798
10799 struct Args_GraphStorageService_lookupIndex {
10800 req: crate::types::LookupIndexRequest,
10801 }
10802 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_lookupIndex {
10803 #[inline]
10804 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.lookupIndex"))]
10805 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10806 static ARGS: &[::fbthrift::Field] = &[
10807 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10808 ];
10809 let mut field_req = ::std::option::Option::None;
10810 let _ = p.read_struct_begin(|_| ())?;
10811 loop {
10812 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10813 match (fty, fid as ::std::primitive::i32) {
10814 (::fbthrift::TType::Stop, _) => break,
10815 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10816 (fty, _) => p.skip(fty)?,
10817 }
10818 p.read_field_end()?;
10819 }
10820 p.read_struct_end()?;
10821 ::std::result::Result::Ok(Self {
10822 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.lookupIndex", "req"))?,
10823 })
10824 }
10825 }
10826
10827 struct Args_GraphStorageService_lookupAndTraverse {
10828 req: crate::types::LookupAndTraverseRequest,
10829 }
10830 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_lookupAndTraverse {
10831 #[inline]
10832 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.lookupAndTraverse"))]
10833 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10834 static ARGS: &[::fbthrift::Field] = &[
10835 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10836 ];
10837 let mut field_req = ::std::option::Option::None;
10838 let _ = p.read_struct_begin(|_| ())?;
10839 loop {
10840 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10841 match (fty, fid as ::std::primitive::i32) {
10842 (::fbthrift::TType::Stop, _) => break,
10843 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10844 (fty, _) => p.skip(fty)?,
10845 }
10846 p.read_field_end()?;
10847 }
10848 p.read_struct_end()?;
10849 ::std::result::Result::Ok(Self {
10850 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.lookupAndTraverse", "req"))?,
10851 })
10852 }
10853 }
10854
10855 struct Args_GraphStorageService_chainUpdateEdge {
10856 req: crate::types::UpdateEdgeRequest,
10857 }
10858 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_chainUpdateEdge {
10859 #[inline]
10860 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.chainUpdateEdge"))]
10861 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10862 static ARGS: &[::fbthrift::Field] = &[
10863 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10864 ];
10865 let mut field_req = ::std::option::Option::None;
10866 let _ = p.read_struct_begin(|_| ())?;
10867 loop {
10868 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10869 match (fty, fid as ::std::primitive::i32) {
10870 (::fbthrift::TType::Stop, _) => break,
10871 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10872 (fty, _) => p.skip(fty)?,
10873 }
10874 p.read_field_end()?;
10875 }
10876 p.read_struct_end()?;
10877 ::std::result::Result::Ok(Self {
10878 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.chainUpdateEdge", "req"))?,
10879 })
10880 }
10881 }
10882
10883 struct Args_GraphStorageService_chainAddEdges {
10884 req: crate::types::AddEdgesRequest,
10885 }
10886 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_chainAddEdges {
10887 #[inline]
10888 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.chainAddEdges"))]
10889 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10890 static ARGS: &[::fbthrift::Field] = &[
10891 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10892 ];
10893 let mut field_req = ::std::option::Option::None;
10894 let _ = p.read_struct_begin(|_| ())?;
10895 loop {
10896 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10897 match (fty, fid as ::std::primitive::i32) {
10898 (::fbthrift::TType::Stop, _) => break,
10899 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10900 (fty, _) => p.skip(fty)?,
10901 }
10902 p.read_field_end()?;
10903 }
10904 p.read_struct_end()?;
10905 ::std::result::Result::Ok(Self {
10906 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.chainAddEdges", "req"))?,
10907 })
10908 }
10909 }
10910
10911 struct Args_GraphStorageService_chainDeleteEdges {
10912 req: crate::types::DeleteEdgesRequest,
10913 }
10914 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_chainDeleteEdges {
10915 #[inline]
10916 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.chainDeleteEdges"))]
10917 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10918 static ARGS: &[::fbthrift::Field] = &[
10919 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10920 ];
10921 let mut field_req = ::std::option::Option::None;
10922 let _ = p.read_struct_begin(|_| ())?;
10923 loop {
10924 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10925 match (fty, fid as ::std::primitive::i32) {
10926 (::fbthrift::TType::Stop, _) => break,
10927 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10928 (fty, _) => p.skip(fty)?,
10929 }
10930 p.read_field_end()?;
10931 }
10932 p.read_struct_end()?;
10933 ::std::result::Result::Ok(Self {
10934 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.chainDeleteEdges", "req"))?,
10935 })
10936 }
10937 }
10938
10939 struct Args_GraphStorageService_get {
10940 req: crate::types::KVGetRequest,
10941 }
10942 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_get {
10943 #[inline]
10944 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.get"))]
10945 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10946 static ARGS: &[::fbthrift::Field] = &[
10947 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10948 ];
10949 let mut field_req = ::std::option::Option::None;
10950 let _ = p.read_struct_begin(|_| ())?;
10951 loop {
10952 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10953 match (fty, fid as ::std::primitive::i32) {
10954 (::fbthrift::TType::Stop, _) => break,
10955 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10956 (fty, _) => p.skip(fty)?,
10957 }
10958 p.read_field_end()?;
10959 }
10960 p.read_struct_end()?;
10961 ::std::result::Result::Ok(Self {
10962 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.get", "req"))?,
10963 })
10964 }
10965 }
10966
10967 struct Args_GraphStorageService_put {
10968 req: crate::types::KVPutRequest,
10969 }
10970 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_put {
10971 #[inline]
10972 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.put"))]
10973 fn read(p: &mut P) -> ::anyhow::Result<Self> {
10974 static ARGS: &[::fbthrift::Field] = &[
10975 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
10976 ];
10977 let mut field_req = ::std::option::Option::None;
10978 let _ = p.read_struct_begin(|_| ())?;
10979 loop {
10980 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
10981 match (fty, fid as ::std::primitive::i32) {
10982 (::fbthrift::TType::Stop, _) => break,
10983 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
10984 (fty, _) => p.skip(fty)?,
10985 }
10986 p.read_field_end()?;
10987 }
10988 p.read_struct_end()?;
10989 ::std::result::Result::Ok(Self {
10990 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.put", "req"))?,
10991 })
10992 }
10993 }
10994
10995 struct Args_GraphStorageService_remove {
10996 req: crate::types::KVRemoveRequest,
10997 }
10998 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_GraphStorageService_remove {
10999 #[inline]
11000 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "GraphStorageService.remove"))]
11001 fn read(p: &mut P) -> ::anyhow::Result<Self> {
11002 static ARGS: &[::fbthrift::Field] = &[
11003 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
11004 ];
11005 let mut field_req = ::std::option::Option::None;
11006 let _ = p.read_struct_begin(|_| ())?;
11007 loop {
11008 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
11009 match (fty, fid as ::std::primitive::i32) {
11010 (::fbthrift::TType::Stop, _) => break,
11011 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
11012 (fty, _) => p.skip(fty)?,
11013 }
11014 p.read_field_end()?;
11015 }
11016 p.read_struct_end()?;
11017 ::std::result::Result::Ok(Self {
11018 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "GraphStorageService.remove", "req"))?,
11019 })
11020 }
11021 }
11022
11023
11024 impl<P, H, R, RS> GraphStorageServiceProcessor<P, H, R, RS>
11025 where
11026 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
11027 P::Frame: ::std::marker::Send + 'static,
11028 P::Deserializer: ::std::marker::Send,
11029 H: GraphStorageService,
11030 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
11031 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
11032 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
11033 + ::std::marker::Send + ::std::marker::Sync,
11034 {
11035 pub fn new(service: H) -> Self {
11036 Self {
11037 service,
11038 supa: ::fbthrift::NullServiceProcessor::new(),
11039 _phantom: ::std::marker::PhantomData,
11040 }
11041 }
11042
11043 pub fn into_inner(self) -> H {
11044 self.service
11045 }
11046
11047 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.getNeighbors"))]
11048 async fn handle_getNeighbors<'a>(
11049 &'a self,
11050 p: &'a mut P::Deserializer,
11051 req_ctxt: &R,
11052 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11053 _seqid: ::std::primitive::u32,
11054 ) -> ::anyhow::Result<()> {
11055 use ::const_cstr::const_cstr;
11056 use ::futures::FutureExt as _;
11057
11058 const_cstr! {
11059 SERVICE_NAME = "GraphStorageService";
11060 METHOD_NAME = "GraphStorageService.getNeighbors";
11061 }
11062 let mut ctx_stack = req_ctxt.get_context_stack(
11063 SERVICE_NAME.as_cstr(),
11064 METHOD_NAME.as_cstr(),
11065 )?;
11066 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11067 let _args: self::Args_GraphStorageService_getNeighbors = ::fbthrift::Deserialize::read(p)?;
11068 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11069 protocol: P::PROTOCOL_ID,
11070 method_name: METHOD_NAME.as_cstr(),
11071 buffer: ::std::marker::PhantomData, })?;
11073 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11074
11075 let res = ::std::panic::AssertUnwindSafe(
11076 self.service.getNeighbors(
11077 _args.req,
11078 )
11079 )
11080 .catch_unwind()
11081 .await;
11082
11083 let res = match res {
11085 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11086 ::tracing::info!("success");
11087 crate::services::graph_storage_service::GetNeighborsExn::Success(res)
11088 }
11089 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::GetNeighborsExn::Success(_))) => {
11090 panic!(
11091 "{} attempted to return success via error",
11092 "getNeighbors",
11093 )
11094 }
11095 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11096 ::tracing::error!(exception = ?exn);
11097 exn
11098 }
11099 ::std::result::Result::Err(exn) => {
11100 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.getNeighbors", exn);
11101 crate::services::graph_storage_service::GetNeighborsExn::ApplicationException(aexn)
11102 }
11103 };
11104
11105 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11106 "getNeighbors",
11107 METHOD_NAME.as_cstr(),
11108 _seqid,
11109 req_ctxt,
11110 &mut ctx_stack,
11111 res
11112 )?;
11113 reply_state.lock().unwrap().send_reply(env);
11114 Ok(())
11115 }
11116
11117 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.getDstBySrc"))]
11118 async fn handle_getDstBySrc<'a>(
11119 &'a self,
11120 p: &'a mut P::Deserializer,
11121 req_ctxt: &R,
11122 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11123 _seqid: ::std::primitive::u32,
11124 ) -> ::anyhow::Result<()> {
11125 use ::const_cstr::const_cstr;
11126 use ::futures::FutureExt as _;
11127
11128 const_cstr! {
11129 SERVICE_NAME = "GraphStorageService";
11130 METHOD_NAME = "GraphStorageService.getDstBySrc";
11131 }
11132 let mut ctx_stack = req_ctxt.get_context_stack(
11133 SERVICE_NAME.as_cstr(),
11134 METHOD_NAME.as_cstr(),
11135 )?;
11136 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11137 let _args: self::Args_GraphStorageService_getDstBySrc = ::fbthrift::Deserialize::read(p)?;
11138 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11139 protocol: P::PROTOCOL_ID,
11140 method_name: METHOD_NAME.as_cstr(),
11141 buffer: ::std::marker::PhantomData, })?;
11143 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11144
11145 let res = ::std::panic::AssertUnwindSafe(
11146 self.service.getDstBySrc(
11147 _args.req,
11148 )
11149 )
11150 .catch_unwind()
11151 .await;
11152
11153 let res = match res {
11155 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11156 ::tracing::info!("success");
11157 crate::services::graph_storage_service::GetDstBySrcExn::Success(res)
11158 }
11159 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::GetDstBySrcExn::Success(_))) => {
11160 panic!(
11161 "{} attempted to return success via error",
11162 "getDstBySrc",
11163 )
11164 }
11165 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11166 ::tracing::error!(exception = ?exn);
11167 exn
11168 }
11169 ::std::result::Result::Err(exn) => {
11170 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.getDstBySrc", exn);
11171 crate::services::graph_storage_service::GetDstBySrcExn::ApplicationException(aexn)
11172 }
11173 };
11174
11175 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11176 "getDstBySrc",
11177 METHOD_NAME.as_cstr(),
11178 _seqid,
11179 req_ctxt,
11180 &mut ctx_stack,
11181 res
11182 )?;
11183 reply_state.lock().unwrap().send_reply(env);
11184 Ok(())
11185 }
11186
11187 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.getProps"))]
11188 async fn handle_getProps<'a>(
11189 &'a self,
11190 p: &'a mut P::Deserializer,
11191 req_ctxt: &R,
11192 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11193 _seqid: ::std::primitive::u32,
11194 ) -> ::anyhow::Result<()> {
11195 use ::const_cstr::const_cstr;
11196 use ::futures::FutureExt as _;
11197
11198 const_cstr! {
11199 SERVICE_NAME = "GraphStorageService";
11200 METHOD_NAME = "GraphStorageService.getProps";
11201 }
11202 let mut ctx_stack = req_ctxt.get_context_stack(
11203 SERVICE_NAME.as_cstr(),
11204 METHOD_NAME.as_cstr(),
11205 )?;
11206 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11207 let _args: self::Args_GraphStorageService_getProps = ::fbthrift::Deserialize::read(p)?;
11208 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11209 protocol: P::PROTOCOL_ID,
11210 method_name: METHOD_NAME.as_cstr(),
11211 buffer: ::std::marker::PhantomData, })?;
11213 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11214
11215 let res = ::std::panic::AssertUnwindSafe(
11216 self.service.getProps(
11217 _args.req,
11218 )
11219 )
11220 .catch_unwind()
11221 .await;
11222
11223 let res = match res {
11225 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11226 ::tracing::info!("success");
11227 crate::services::graph_storage_service::GetPropsExn::Success(res)
11228 }
11229 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::GetPropsExn::Success(_))) => {
11230 panic!(
11231 "{} attempted to return success via error",
11232 "getProps",
11233 )
11234 }
11235 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11236 ::tracing::error!(exception = ?exn);
11237 exn
11238 }
11239 ::std::result::Result::Err(exn) => {
11240 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.getProps", exn);
11241 crate::services::graph_storage_service::GetPropsExn::ApplicationException(aexn)
11242 }
11243 };
11244
11245 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11246 "getProps",
11247 METHOD_NAME.as_cstr(),
11248 _seqid,
11249 req_ctxt,
11250 &mut ctx_stack,
11251 res
11252 )?;
11253 reply_state.lock().unwrap().send_reply(env);
11254 Ok(())
11255 }
11256
11257 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.addVertices"))]
11258 async fn handle_addVertices<'a>(
11259 &'a self,
11260 p: &'a mut P::Deserializer,
11261 req_ctxt: &R,
11262 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11263 _seqid: ::std::primitive::u32,
11264 ) -> ::anyhow::Result<()> {
11265 use ::const_cstr::const_cstr;
11266 use ::futures::FutureExt as _;
11267
11268 const_cstr! {
11269 SERVICE_NAME = "GraphStorageService";
11270 METHOD_NAME = "GraphStorageService.addVertices";
11271 }
11272 let mut ctx_stack = req_ctxt.get_context_stack(
11273 SERVICE_NAME.as_cstr(),
11274 METHOD_NAME.as_cstr(),
11275 )?;
11276 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11277 let _args: self::Args_GraphStorageService_addVertices = ::fbthrift::Deserialize::read(p)?;
11278 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11279 protocol: P::PROTOCOL_ID,
11280 method_name: METHOD_NAME.as_cstr(),
11281 buffer: ::std::marker::PhantomData, })?;
11283 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11284
11285 let res = ::std::panic::AssertUnwindSafe(
11286 self.service.addVertices(
11287 _args.req,
11288 )
11289 )
11290 .catch_unwind()
11291 .await;
11292
11293 let res = match res {
11295 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11296 ::tracing::info!("success");
11297 crate::services::graph_storage_service::AddVerticesExn::Success(res)
11298 }
11299 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::AddVerticesExn::Success(_))) => {
11300 panic!(
11301 "{} attempted to return success via error",
11302 "addVertices",
11303 )
11304 }
11305 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11306 ::tracing::error!(exception = ?exn);
11307 exn
11308 }
11309 ::std::result::Result::Err(exn) => {
11310 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.addVertices", exn);
11311 crate::services::graph_storage_service::AddVerticesExn::ApplicationException(aexn)
11312 }
11313 };
11314
11315 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11316 "addVertices",
11317 METHOD_NAME.as_cstr(),
11318 _seqid,
11319 req_ctxt,
11320 &mut ctx_stack,
11321 res
11322 )?;
11323 reply_state.lock().unwrap().send_reply(env);
11324 Ok(())
11325 }
11326
11327 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.addEdges"))]
11328 async fn handle_addEdges<'a>(
11329 &'a self,
11330 p: &'a mut P::Deserializer,
11331 req_ctxt: &R,
11332 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11333 _seqid: ::std::primitive::u32,
11334 ) -> ::anyhow::Result<()> {
11335 use ::const_cstr::const_cstr;
11336 use ::futures::FutureExt as _;
11337
11338 const_cstr! {
11339 SERVICE_NAME = "GraphStorageService";
11340 METHOD_NAME = "GraphStorageService.addEdges";
11341 }
11342 let mut ctx_stack = req_ctxt.get_context_stack(
11343 SERVICE_NAME.as_cstr(),
11344 METHOD_NAME.as_cstr(),
11345 )?;
11346 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11347 let _args: self::Args_GraphStorageService_addEdges = ::fbthrift::Deserialize::read(p)?;
11348 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11349 protocol: P::PROTOCOL_ID,
11350 method_name: METHOD_NAME.as_cstr(),
11351 buffer: ::std::marker::PhantomData, })?;
11353 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11354
11355 let res = ::std::panic::AssertUnwindSafe(
11356 self.service.addEdges(
11357 _args.req,
11358 )
11359 )
11360 .catch_unwind()
11361 .await;
11362
11363 let res = match res {
11365 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11366 ::tracing::info!("success");
11367 crate::services::graph_storage_service::AddEdgesExn::Success(res)
11368 }
11369 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::AddEdgesExn::Success(_))) => {
11370 panic!(
11371 "{} attempted to return success via error",
11372 "addEdges",
11373 )
11374 }
11375 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11376 ::tracing::error!(exception = ?exn);
11377 exn
11378 }
11379 ::std::result::Result::Err(exn) => {
11380 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.addEdges", exn);
11381 crate::services::graph_storage_service::AddEdgesExn::ApplicationException(aexn)
11382 }
11383 };
11384
11385 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11386 "addEdges",
11387 METHOD_NAME.as_cstr(),
11388 _seqid,
11389 req_ctxt,
11390 &mut ctx_stack,
11391 res
11392 )?;
11393 reply_state.lock().unwrap().send_reply(env);
11394 Ok(())
11395 }
11396
11397 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.deleteEdges"))]
11398 async fn handle_deleteEdges<'a>(
11399 &'a self,
11400 p: &'a mut P::Deserializer,
11401 req_ctxt: &R,
11402 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11403 _seqid: ::std::primitive::u32,
11404 ) -> ::anyhow::Result<()> {
11405 use ::const_cstr::const_cstr;
11406 use ::futures::FutureExt as _;
11407
11408 const_cstr! {
11409 SERVICE_NAME = "GraphStorageService";
11410 METHOD_NAME = "GraphStorageService.deleteEdges";
11411 }
11412 let mut ctx_stack = req_ctxt.get_context_stack(
11413 SERVICE_NAME.as_cstr(),
11414 METHOD_NAME.as_cstr(),
11415 )?;
11416 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11417 let _args: self::Args_GraphStorageService_deleteEdges = ::fbthrift::Deserialize::read(p)?;
11418 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11419 protocol: P::PROTOCOL_ID,
11420 method_name: METHOD_NAME.as_cstr(),
11421 buffer: ::std::marker::PhantomData, })?;
11423 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11424
11425 let res = ::std::panic::AssertUnwindSafe(
11426 self.service.deleteEdges(
11427 _args.req,
11428 )
11429 )
11430 .catch_unwind()
11431 .await;
11432
11433 let res = match res {
11435 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11436 ::tracing::info!("success");
11437 crate::services::graph_storage_service::DeleteEdgesExn::Success(res)
11438 }
11439 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::DeleteEdgesExn::Success(_))) => {
11440 panic!(
11441 "{} attempted to return success via error",
11442 "deleteEdges",
11443 )
11444 }
11445 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11446 ::tracing::error!(exception = ?exn);
11447 exn
11448 }
11449 ::std::result::Result::Err(exn) => {
11450 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.deleteEdges", exn);
11451 crate::services::graph_storage_service::DeleteEdgesExn::ApplicationException(aexn)
11452 }
11453 };
11454
11455 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11456 "deleteEdges",
11457 METHOD_NAME.as_cstr(),
11458 _seqid,
11459 req_ctxt,
11460 &mut ctx_stack,
11461 res
11462 )?;
11463 reply_state.lock().unwrap().send_reply(env);
11464 Ok(())
11465 }
11466
11467 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.deleteVertices"))]
11468 async fn handle_deleteVertices<'a>(
11469 &'a self,
11470 p: &'a mut P::Deserializer,
11471 req_ctxt: &R,
11472 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11473 _seqid: ::std::primitive::u32,
11474 ) -> ::anyhow::Result<()> {
11475 use ::const_cstr::const_cstr;
11476 use ::futures::FutureExt as _;
11477
11478 const_cstr! {
11479 SERVICE_NAME = "GraphStorageService";
11480 METHOD_NAME = "GraphStorageService.deleteVertices";
11481 }
11482 let mut ctx_stack = req_ctxt.get_context_stack(
11483 SERVICE_NAME.as_cstr(),
11484 METHOD_NAME.as_cstr(),
11485 )?;
11486 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11487 let _args: self::Args_GraphStorageService_deleteVertices = ::fbthrift::Deserialize::read(p)?;
11488 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11489 protocol: P::PROTOCOL_ID,
11490 method_name: METHOD_NAME.as_cstr(),
11491 buffer: ::std::marker::PhantomData, })?;
11493 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11494
11495 let res = ::std::panic::AssertUnwindSafe(
11496 self.service.deleteVertices(
11497 _args.req,
11498 )
11499 )
11500 .catch_unwind()
11501 .await;
11502
11503 let res = match res {
11505 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11506 ::tracing::info!("success");
11507 crate::services::graph_storage_service::DeleteVerticesExn::Success(res)
11508 }
11509 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::DeleteVerticesExn::Success(_))) => {
11510 panic!(
11511 "{} attempted to return success via error",
11512 "deleteVertices",
11513 )
11514 }
11515 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11516 ::tracing::error!(exception = ?exn);
11517 exn
11518 }
11519 ::std::result::Result::Err(exn) => {
11520 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.deleteVertices", exn);
11521 crate::services::graph_storage_service::DeleteVerticesExn::ApplicationException(aexn)
11522 }
11523 };
11524
11525 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11526 "deleteVertices",
11527 METHOD_NAME.as_cstr(),
11528 _seqid,
11529 req_ctxt,
11530 &mut ctx_stack,
11531 res
11532 )?;
11533 reply_state.lock().unwrap().send_reply(env);
11534 Ok(())
11535 }
11536
11537 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.deleteTags"))]
11538 async fn handle_deleteTags<'a>(
11539 &'a self,
11540 p: &'a mut P::Deserializer,
11541 req_ctxt: &R,
11542 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11543 _seqid: ::std::primitive::u32,
11544 ) -> ::anyhow::Result<()> {
11545 use ::const_cstr::const_cstr;
11546 use ::futures::FutureExt as _;
11547
11548 const_cstr! {
11549 SERVICE_NAME = "GraphStorageService";
11550 METHOD_NAME = "GraphStorageService.deleteTags";
11551 }
11552 let mut ctx_stack = req_ctxt.get_context_stack(
11553 SERVICE_NAME.as_cstr(),
11554 METHOD_NAME.as_cstr(),
11555 )?;
11556 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11557 let _args: self::Args_GraphStorageService_deleteTags = ::fbthrift::Deserialize::read(p)?;
11558 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11559 protocol: P::PROTOCOL_ID,
11560 method_name: METHOD_NAME.as_cstr(),
11561 buffer: ::std::marker::PhantomData, })?;
11563 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11564
11565 let res = ::std::panic::AssertUnwindSafe(
11566 self.service.deleteTags(
11567 _args.req,
11568 )
11569 )
11570 .catch_unwind()
11571 .await;
11572
11573 let res = match res {
11575 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11576 ::tracing::info!("success");
11577 crate::services::graph_storage_service::DeleteTagsExn::Success(res)
11578 }
11579 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::DeleteTagsExn::Success(_))) => {
11580 panic!(
11581 "{} attempted to return success via error",
11582 "deleteTags",
11583 )
11584 }
11585 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11586 ::tracing::error!(exception = ?exn);
11587 exn
11588 }
11589 ::std::result::Result::Err(exn) => {
11590 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.deleteTags", exn);
11591 crate::services::graph_storage_service::DeleteTagsExn::ApplicationException(aexn)
11592 }
11593 };
11594
11595 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11596 "deleteTags",
11597 METHOD_NAME.as_cstr(),
11598 _seqid,
11599 req_ctxt,
11600 &mut ctx_stack,
11601 res
11602 )?;
11603 reply_state.lock().unwrap().send_reply(env);
11604 Ok(())
11605 }
11606
11607 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.updateVertex"))]
11608 async fn handle_updateVertex<'a>(
11609 &'a self,
11610 p: &'a mut P::Deserializer,
11611 req_ctxt: &R,
11612 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11613 _seqid: ::std::primitive::u32,
11614 ) -> ::anyhow::Result<()> {
11615 use ::const_cstr::const_cstr;
11616 use ::futures::FutureExt as _;
11617
11618 const_cstr! {
11619 SERVICE_NAME = "GraphStorageService";
11620 METHOD_NAME = "GraphStorageService.updateVertex";
11621 }
11622 let mut ctx_stack = req_ctxt.get_context_stack(
11623 SERVICE_NAME.as_cstr(),
11624 METHOD_NAME.as_cstr(),
11625 )?;
11626 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11627 let _args: self::Args_GraphStorageService_updateVertex = ::fbthrift::Deserialize::read(p)?;
11628 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11629 protocol: P::PROTOCOL_ID,
11630 method_name: METHOD_NAME.as_cstr(),
11631 buffer: ::std::marker::PhantomData, })?;
11633 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11634
11635 let res = ::std::panic::AssertUnwindSafe(
11636 self.service.updateVertex(
11637 _args.req,
11638 )
11639 )
11640 .catch_unwind()
11641 .await;
11642
11643 let res = match res {
11645 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11646 ::tracing::info!("success");
11647 crate::services::graph_storage_service::UpdateVertexExn::Success(res)
11648 }
11649 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::UpdateVertexExn::Success(_))) => {
11650 panic!(
11651 "{} attempted to return success via error",
11652 "updateVertex",
11653 )
11654 }
11655 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11656 ::tracing::error!(exception = ?exn);
11657 exn
11658 }
11659 ::std::result::Result::Err(exn) => {
11660 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.updateVertex", exn);
11661 crate::services::graph_storage_service::UpdateVertexExn::ApplicationException(aexn)
11662 }
11663 };
11664
11665 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11666 "updateVertex",
11667 METHOD_NAME.as_cstr(),
11668 _seqid,
11669 req_ctxt,
11670 &mut ctx_stack,
11671 res
11672 )?;
11673 reply_state.lock().unwrap().send_reply(env);
11674 Ok(())
11675 }
11676
11677 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.updateEdge"))]
11678 async fn handle_updateEdge<'a>(
11679 &'a self,
11680 p: &'a mut P::Deserializer,
11681 req_ctxt: &R,
11682 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11683 _seqid: ::std::primitive::u32,
11684 ) -> ::anyhow::Result<()> {
11685 use ::const_cstr::const_cstr;
11686 use ::futures::FutureExt as _;
11687
11688 const_cstr! {
11689 SERVICE_NAME = "GraphStorageService";
11690 METHOD_NAME = "GraphStorageService.updateEdge";
11691 }
11692 let mut ctx_stack = req_ctxt.get_context_stack(
11693 SERVICE_NAME.as_cstr(),
11694 METHOD_NAME.as_cstr(),
11695 )?;
11696 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11697 let _args: self::Args_GraphStorageService_updateEdge = ::fbthrift::Deserialize::read(p)?;
11698 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11699 protocol: P::PROTOCOL_ID,
11700 method_name: METHOD_NAME.as_cstr(),
11701 buffer: ::std::marker::PhantomData, })?;
11703 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11704
11705 let res = ::std::panic::AssertUnwindSafe(
11706 self.service.updateEdge(
11707 _args.req,
11708 )
11709 )
11710 .catch_unwind()
11711 .await;
11712
11713 let res = match res {
11715 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11716 ::tracing::info!("success");
11717 crate::services::graph_storage_service::UpdateEdgeExn::Success(res)
11718 }
11719 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::UpdateEdgeExn::Success(_))) => {
11720 panic!(
11721 "{} attempted to return success via error",
11722 "updateEdge",
11723 )
11724 }
11725 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11726 ::tracing::error!(exception = ?exn);
11727 exn
11728 }
11729 ::std::result::Result::Err(exn) => {
11730 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.updateEdge", exn);
11731 crate::services::graph_storage_service::UpdateEdgeExn::ApplicationException(aexn)
11732 }
11733 };
11734
11735 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11736 "updateEdge",
11737 METHOD_NAME.as_cstr(),
11738 _seqid,
11739 req_ctxt,
11740 &mut ctx_stack,
11741 res
11742 )?;
11743 reply_state.lock().unwrap().send_reply(env);
11744 Ok(())
11745 }
11746
11747 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.scanVertex"))]
11748 async fn handle_scanVertex<'a>(
11749 &'a self,
11750 p: &'a mut P::Deserializer,
11751 req_ctxt: &R,
11752 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11753 _seqid: ::std::primitive::u32,
11754 ) -> ::anyhow::Result<()> {
11755 use ::const_cstr::const_cstr;
11756 use ::futures::FutureExt as _;
11757
11758 const_cstr! {
11759 SERVICE_NAME = "GraphStorageService";
11760 METHOD_NAME = "GraphStorageService.scanVertex";
11761 }
11762 let mut ctx_stack = req_ctxt.get_context_stack(
11763 SERVICE_NAME.as_cstr(),
11764 METHOD_NAME.as_cstr(),
11765 )?;
11766 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11767 let _args: self::Args_GraphStorageService_scanVertex = ::fbthrift::Deserialize::read(p)?;
11768 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11769 protocol: P::PROTOCOL_ID,
11770 method_name: METHOD_NAME.as_cstr(),
11771 buffer: ::std::marker::PhantomData, })?;
11773 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11774
11775 let res = ::std::panic::AssertUnwindSafe(
11776 self.service.scanVertex(
11777 _args.req,
11778 )
11779 )
11780 .catch_unwind()
11781 .await;
11782
11783 let res = match res {
11785 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11786 ::tracing::info!("success");
11787 crate::services::graph_storage_service::ScanVertexExn::Success(res)
11788 }
11789 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::ScanVertexExn::Success(_))) => {
11790 panic!(
11791 "{} attempted to return success via error",
11792 "scanVertex",
11793 )
11794 }
11795 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11796 ::tracing::error!(exception = ?exn);
11797 exn
11798 }
11799 ::std::result::Result::Err(exn) => {
11800 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.scanVertex", exn);
11801 crate::services::graph_storage_service::ScanVertexExn::ApplicationException(aexn)
11802 }
11803 };
11804
11805 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11806 "scanVertex",
11807 METHOD_NAME.as_cstr(),
11808 _seqid,
11809 req_ctxt,
11810 &mut ctx_stack,
11811 res
11812 )?;
11813 reply_state.lock().unwrap().send_reply(env);
11814 Ok(())
11815 }
11816
11817 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.scanEdge"))]
11818 async fn handle_scanEdge<'a>(
11819 &'a self,
11820 p: &'a mut P::Deserializer,
11821 req_ctxt: &R,
11822 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11823 _seqid: ::std::primitive::u32,
11824 ) -> ::anyhow::Result<()> {
11825 use ::const_cstr::const_cstr;
11826 use ::futures::FutureExt as _;
11827
11828 const_cstr! {
11829 SERVICE_NAME = "GraphStorageService";
11830 METHOD_NAME = "GraphStorageService.scanEdge";
11831 }
11832 let mut ctx_stack = req_ctxt.get_context_stack(
11833 SERVICE_NAME.as_cstr(),
11834 METHOD_NAME.as_cstr(),
11835 )?;
11836 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11837 let _args: self::Args_GraphStorageService_scanEdge = ::fbthrift::Deserialize::read(p)?;
11838 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11839 protocol: P::PROTOCOL_ID,
11840 method_name: METHOD_NAME.as_cstr(),
11841 buffer: ::std::marker::PhantomData, })?;
11843 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11844
11845 let res = ::std::panic::AssertUnwindSafe(
11846 self.service.scanEdge(
11847 _args.req,
11848 )
11849 )
11850 .catch_unwind()
11851 .await;
11852
11853 let res = match res {
11855 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11856 ::tracing::info!("success");
11857 crate::services::graph_storage_service::ScanEdgeExn::Success(res)
11858 }
11859 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::ScanEdgeExn::Success(_))) => {
11860 panic!(
11861 "{} attempted to return success via error",
11862 "scanEdge",
11863 )
11864 }
11865 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11866 ::tracing::error!(exception = ?exn);
11867 exn
11868 }
11869 ::std::result::Result::Err(exn) => {
11870 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.scanEdge", exn);
11871 crate::services::graph_storage_service::ScanEdgeExn::ApplicationException(aexn)
11872 }
11873 };
11874
11875 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11876 "scanEdge",
11877 METHOD_NAME.as_cstr(),
11878 _seqid,
11879 req_ctxt,
11880 &mut ctx_stack,
11881 res
11882 )?;
11883 reply_state.lock().unwrap().send_reply(env);
11884 Ok(())
11885 }
11886
11887 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.getUUID"))]
11888 async fn handle_getUUID<'a>(
11889 &'a self,
11890 p: &'a mut P::Deserializer,
11891 req_ctxt: &R,
11892 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11893 _seqid: ::std::primitive::u32,
11894 ) -> ::anyhow::Result<()> {
11895 use ::const_cstr::const_cstr;
11896 use ::futures::FutureExt as _;
11897
11898 const_cstr! {
11899 SERVICE_NAME = "GraphStorageService";
11900 METHOD_NAME = "GraphStorageService.getUUID";
11901 }
11902 let mut ctx_stack = req_ctxt.get_context_stack(
11903 SERVICE_NAME.as_cstr(),
11904 METHOD_NAME.as_cstr(),
11905 )?;
11906 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11907 let _args: self::Args_GraphStorageService_getUUID = ::fbthrift::Deserialize::read(p)?;
11908 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11909 protocol: P::PROTOCOL_ID,
11910 method_name: METHOD_NAME.as_cstr(),
11911 buffer: ::std::marker::PhantomData, })?;
11913 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11914
11915 let res = ::std::panic::AssertUnwindSafe(
11916 self.service.getUUID(
11917 _args.req,
11918 )
11919 )
11920 .catch_unwind()
11921 .await;
11922
11923 let res = match res {
11925 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11926 ::tracing::info!("success");
11927 crate::services::graph_storage_service::GetUUIDExn::Success(res)
11928 }
11929 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::GetUUIDExn::Success(_))) => {
11930 panic!(
11931 "{} attempted to return success via error",
11932 "getUUID",
11933 )
11934 }
11935 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
11936 ::tracing::error!(exception = ?exn);
11937 exn
11938 }
11939 ::std::result::Result::Err(exn) => {
11940 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.getUUID", exn);
11941 crate::services::graph_storage_service::GetUUIDExn::ApplicationException(aexn)
11942 }
11943 };
11944
11945 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
11946 "getUUID",
11947 METHOD_NAME.as_cstr(),
11948 _seqid,
11949 req_ctxt,
11950 &mut ctx_stack,
11951 res
11952 )?;
11953 reply_state.lock().unwrap().send_reply(env);
11954 Ok(())
11955 }
11956
11957 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.lookupIndex"))]
11958 async fn handle_lookupIndex<'a>(
11959 &'a self,
11960 p: &'a mut P::Deserializer,
11961 req_ctxt: &R,
11962 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
11963 _seqid: ::std::primitive::u32,
11964 ) -> ::anyhow::Result<()> {
11965 use ::const_cstr::const_cstr;
11966 use ::futures::FutureExt as _;
11967
11968 const_cstr! {
11969 SERVICE_NAME = "GraphStorageService";
11970 METHOD_NAME = "GraphStorageService.lookupIndex";
11971 }
11972 let mut ctx_stack = req_ctxt.get_context_stack(
11973 SERVICE_NAME.as_cstr(),
11974 METHOD_NAME.as_cstr(),
11975 )?;
11976 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
11977 let _args: self::Args_GraphStorageService_lookupIndex = ::fbthrift::Deserialize::read(p)?;
11978 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
11979 protocol: P::PROTOCOL_ID,
11980 method_name: METHOD_NAME.as_cstr(),
11981 buffer: ::std::marker::PhantomData, })?;
11983 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
11984
11985 let res = ::std::panic::AssertUnwindSafe(
11986 self.service.lookupIndex(
11987 _args.req,
11988 )
11989 )
11990 .catch_unwind()
11991 .await;
11992
11993 let res = match res {
11995 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
11996 ::tracing::info!("success");
11997 crate::services::graph_storage_service::LookupIndexExn::Success(res)
11998 }
11999 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::LookupIndexExn::Success(_))) => {
12000 panic!(
12001 "{} attempted to return success via error",
12002 "lookupIndex",
12003 )
12004 }
12005 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12006 ::tracing::error!(exception = ?exn);
12007 exn
12008 }
12009 ::std::result::Result::Err(exn) => {
12010 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.lookupIndex", exn);
12011 crate::services::graph_storage_service::LookupIndexExn::ApplicationException(aexn)
12012 }
12013 };
12014
12015 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12016 "lookupIndex",
12017 METHOD_NAME.as_cstr(),
12018 _seqid,
12019 req_ctxt,
12020 &mut ctx_stack,
12021 res
12022 )?;
12023 reply_state.lock().unwrap().send_reply(env);
12024 Ok(())
12025 }
12026
12027 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.lookupAndTraverse"))]
12028 async fn handle_lookupAndTraverse<'a>(
12029 &'a self,
12030 p: &'a mut P::Deserializer,
12031 req_ctxt: &R,
12032 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12033 _seqid: ::std::primitive::u32,
12034 ) -> ::anyhow::Result<()> {
12035 use ::const_cstr::const_cstr;
12036 use ::futures::FutureExt as _;
12037
12038 const_cstr! {
12039 SERVICE_NAME = "GraphStorageService";
12040 METHOD_NAME = "GraphStorageService.lookupAndTraverse";
12041 }
12042 let mut ctx_stack = req_ctxt.get_context_stack(
12043 SERVICE_NAME.as_cstr(),
12044 METHOD_NAME.as_cstr(),
12045 )?;
12046 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12047 let _args: self::Args_GraphStorageService_lookupAndTraverse = ::fbthrift::Deserialize::read(p)?;
12048 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12049 protocol: P::PROTOCOL_ID,
12050 method_name: METHOD_NAME.as_cstr(),
12051 buffer: ::std::marker::PhantomData, })?;
12053 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12054
12055 let res = ::std::panic::AssertUnwindSafe(
12056 self.service.lookupAndTraverse(
12057 _args.req,
12058 )
12059 )
12060 .catch_unwind()
12061 .await;
12062
12063 let res = match res {
12065 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12066 ::tracing::info!("success");
12067 crate::services::graph_storage_service::LookupAndTraverseExn::Success(res)
12068 }
12069 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::LookupAndTraverseExn::Success(_))) => {
12070 panic!(
12071 "{} attempted to return success via error",
12072 "lookupAndTraverse",
12073 )
12074 }
12075 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12076 ::tracing::error!(exception = ?exn);
12077 exn
12078 }
12079 ::std::result::Result::Err(exn) => {
12080 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.lookupAndTraverse", exn);
12081 crate::services::graph_storage_service::LookupAndTraverseExn::ApplicationException(aexn)
12082 }
12083 };
12084
12085 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12086 "lookupAndTraverse",
12087 METHOD_NAME.as_cstr(),
12088 _seqid,
12089 req_ctxt,
12090 &mut ctx_stack,
12091 res
12092 )?;
12093 reply_state.lock().unwrap().send_reply(env);
12094 Ok(())
12095 }
12096
12097 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.chainUpdateEdge"))]
12098 async fn handle_chainUpdateEdge<'a>(
12099 &'a self,
12100 p: &'a mut P::Deserializer,
12101 req_ctxt: &R,
12102 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12103 _seqid: ::std::primitive::u32,
12104 ) -> ::anyhow::Result<()> {
12105 use ::const_cstr::const_cstr;
12106 use ::futures::FutureExt as _;
12107
12108 const_cstr! {
12109 SERVICE_NAME = "GraphStorageService";
12110 METHOD_NAME = "GraphStorageService.chainUpdateEdge";
12111 }
12112 let mut ctx_stack = req_ctxt.get_context_stack(
12113 SERVICE_NAME.as_cstr(),
12114 METHOD_NAME.as_cstr(),
12115 )?;
12116 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12117 let _args: self::Args_GraphStorageService_chainUpdateEdge = ::fbthrift::Deserialize::read(p)?;
12118 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12119 protocol: P::PROTOCOL_ID,
12120 method_name: METHOD_NAME.as_cstr(),
12121 buffer: ::std::marker::PhantomData, })?;
12123 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12124
12125 let res = ::std::panic::AssertUnwindSafe(
12126 self.service.chainUpdateEdge(
12127 _args.req,
12128 )
12129 )
12130 .catch_unwind()
12131 .await;
12132
12133 let res = match res {
12135 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12136 ::tracing::info!("success");
12137 crate::services::graph_storage_service::ChainUpdateEdgeExn::Success(res)
12138 }
12139 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::ChainUpdateEdgeExn::Success(_))) => {
12140 panic!(
12141 "{} attempted to return success via error",
12142 "chainUpdateEdge",
12143 )
12144 }
12145 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12146 ::tracing::error!(exception = ?exn);
12147 exn
12148 }
12149 ::std::result::Result::Err(exn) => {
12150 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.chainUpdateEdge", exn);
12151 crate::services::graph_storage_service::ChainUpdateEdgeExn::ApplicationException(aexn)
12152 }
12153 };
12154
12155 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12156 "chainUpdateEdge",
12157 METHOD_NAME.as_cstr(),
12158 _seqid,
12159 req_ctxt,
12160 &mut ctx_stack,
12161 res
12162 )?;
12163 reply_state.lock().unwrap().send_reply(env);
12164 Ok(())
12165 }
12166
12167 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.chainAddEdges"))]
12168 async fn handle_chainAddEdges<'a>(
12169 &'a self,
12170 p: &'a mut P::Deserializer,
12171 req_ctxt: &R,
12172 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12173 _seqid: ::std::primitive::u32,
12174 ) -> ::anyhow::Result<()> {
12175 use ::const_cstr::const_cstr;
12176 use ::futures::FutureExt as _;
12177
12178 const_cstr! {
12179 SERVICE_NAME = "GraphStorageService";
12180 METHOD_NAME = "GraphStorageService.chainAddEdges";
12181 }
12182 let mut ctx_stack = req_ctxt.get_context_stack(
12183 SERVICE_NAME.as_cstr(),
12184 METHOD_NAME.as_cstr(),
12185 )?;
12186 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12187 let _args: self::Args_GraphStorageService_chainAddEdges = ::fbthrift::Deserialize::read(p)?;
12188 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12189 protocol: P::PROTOCOL_ID,
12190 method_name: METHOD_NAME.as_cstr(),
12191 buffer: ::std::marker::PhantomData, })?;
12193 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12194
12195 let res = ::std::panic::AssertUnwindSafe(
12196 self.service.chainAddEdges(
12197 _args.req,
12198 )
12199 )
12200 .catch_unwind()
12201 .await;
12202
12203 let res = match res {
12205 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12206 ::tracing::info!("success");
12207 crate::services::graph_storage_service::ChainAddEdgesExn::Success(res)
12208 }
12209 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::ChainAddEdgesExn::Success(_))) => {
12210 panic!(
12211 "{} attempted to return success via error",
12212 "chainAddEdges",
12213 )
12214 }
12215 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12216 ::tracing::error!(exception = ?exn);
12217 exn
12218 }
12219 ::std::result::Result::Err(exn) => {
12220 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.chainAddEdges", exn);
12221 crate::services::graph_storage_service::ChainAddEdgesExn::ApplicationException(aexn)
12222 }
12223 };
12224
12225 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12226 "chainAddEdges",
12227 METHOD_NAME.as_cstr(),
12228 _seqid,
12229 req_ctxt,
12230 &mut ctx_stack,
12231 res
12232 )?;
12233 reply_state.lock().unwrap().send_reply(env);
12234 Ok(())
12235 }
12236
12237 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.chainDeleteEdges"))]
12238 async fn handle_chainDeleteEdges<'a>(
12239 &'a self,
12240 p: &'a mut P::Deserializer,
12241 req_ctxt: &R,
12242 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12243 _seqid: ::std::primitive::u32,
12244 ) -> ::anyhow::Result<()> {
12245 use ::const_cstr::const_cstr;
12246 use ::futures::FutureExt as _;
12247
12248 const_cstr! {
12249 SERVICE_NAME = "GraphStorageService";
12250 METHOD_NAME = "GraphStorageService.chainDeleteEdges";
12251 }
12252 let mut ctx_stack = req_ctxt.get_context_stack(
12253 SERVICE_NAME.as_cstr(),
12254 METHOD_NAME.as_cstr(),
12255 )?;
12256 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12257 let _args: self::Args_GraphStorageService_chainDeleteEdges = ::fbthrift::Deserialize::read(p)?;
12258 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12259 protocol: P::PROTOCOL_ID,
12260 method_name: METHOD_NAME.as_cstr(),
12261 buffer: ::std::marker::PhantomData, })?;
12263 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12264
12265 let res = ::std::panic::AssertUnwindSafe(
12266 self.service.chainDeleteEdges(
12267 _args.req,
12268 )
12269 )
12270 .catch_unwind()
12271 .await;
12272
12273 let res = match res {
12275 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12276 ::tracing::info!("success");
12277 crate::services::graph_storage_service::ChainDeleteEdgesExn::Success(res)
12278 }
12279 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::ChainDeleteEdgesExn::Success(_))) => {
12280 panic!(
12281 "{} attempted to return success via error",
12282 "chainDeleteEdges",
12283 )
12284 }
12285 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12286 ::tracing::error!(exception = ?exn);
12287 exn
12288 }
12289 ::std::result::Result::Err(exn) => {
12290 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.chainDeleteEdges", exn);
12291 crate::services::graph_storage_service::ChainDeleteEdgesExn::ApplicationException(aexn)
12292 }
12293 };
12294
12295 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12296 "chainDeleteEdges",
12297 METHOD_NAME.as_cstr(),
12298 _seqid,
12299 req_ctxt,
12300 &mut ctx_stack,
12301 res
12302 )?;
12303 reply_state.lock().unwrap().send_reply(env);
12304 Ok(())
12305 }
12306
12307 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.get"))]
12308 async fn handle_get<'a>(
12309 &'a self,
12310 p: &'a mut P::Deserializer,
12311 req_ctxt: &R,
12312 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12313 _seqid: ::std::primitive::u32,
12314 ) -> ::anyhow::Result<()> {
12315 use ::const_cstr::const_cstr;
12316 use ::futures::FutureExt as _;
12317
12318 const_cstr! {
12319 SERVICE_NAME = "GraphStorageService";
12320 METHOD_NAME = "GraphStorageService.get";
12321 }
12322 let mut ctx_stack = req_ctxt.get_context_stack(
12323 SERVICE_NAME.as_cstr(),
12324 METHOD_NAME.as_cstr(),
12325 )?;
12326 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12327 let _args: self::Args_GraphStorageService_get = ::fbthrift::Deserialize::read(p)?;
12328 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12329 protocol: P::PROTOCOL_ID,
12330 method_name: METHOD_NAME.as_cstr(),
12331 buffer: ::std::marker::PhantomData, })?;
12333 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12334
12335 let res = ::std::panic::AssertUnwindSafe(
12336 self.service.get(
12337 _args.req,
12338 )
12339 )
12340 .catch_unwind()
12341 .await;
12342
12343 let res = match res {
12345 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12346 ::tracing::info!("success");
12347 crate::services::graph_storage_service::GetExn::Success(res)
12348 }
12349 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::GetExn::Success(_))) => {
12350 panic!(
12351 "{} attempted to return success via error",
12352 "get",
12353 )
12354 }
12355 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12356 ::tracing::error!(exception = ?exn);
12357 exn
12358 }
12359 ::std::result::Result::Err(exn) => {
12360 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.get", exn);
12361 crate::services::graph_storage_service::GetExn::ApplicationException(aexn)
12362 }
12363 };
12364
12365 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12366 "get",
12367 METHOD_NAME.as_cstr(),
12368 _seqid,
12369 req_ctxt,
12370 &mut ctx_stack,
12371 res
12372 )?;
12373 reply_state.lock().unwrap().send_reply(env);
12374 Ok(())
12375 }
12376
12377 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.put"))]
12378 async fn handle_put<'a>(
12379 &'a self,
12380 p: &'a mut P::Deserializer,
12381 req_ctxt: &R,
12382 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12383 _seqid: ::std::primitive::u32,
12384 ) -> ::anyhow::Result<()> {
12385 use ::const_cstr::const_cstr;
12386 use ::futures::FutureExt as _;
12387
12388 const_cstr! {
12389 SERVICE_NAME = "GraphStorageService";
12390 METHOD_NAME = "GraphStorageService.put";
12391 }
12392 let mut ctx_stack = req_ctxt.get_context_stack(
12393 SERVICE_NAME.as_cstr(),
12394 METHOD_NAME.as_cstr(),
12395 )?;
12396 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12397 let _args: self::Args_GraphStorageService_put = ::fbthrift::Deserialize::read(p)?;
12398 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12399 protocol: P::PROTOCOL_ID,
12400 method_name: METHOD_NAME.as_cstr(),
12401 buffer: ::std::marker::PhantomData, })?;
12403 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12404
12405 let res = ::std::panic::AssertUnwindSafe(
12406 self.service.put(
12407 _args.req,
12408 )
12409 )
12410 .catch_unwind()
12411 .await;
12412
12413 let res = match res {
12415 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12416 ::tracing::info!("success");
12417 crate::services::graph_storage_service::PutExn::Success(res)
12418 }
12419 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::PutExn::Success(_))) => {
12420 panic!(
12421 "{} attempted to return success via error",
12422 "put",
12423 )
12424 }
12425 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12426 ::tracing::error!(exception = ?exn);
12427 exn
12428 }
12429 ::std::result::Result::Err(exn) => {
12430 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.put", exn);
12431 crate::services::graph_storage_service::PutExn::ApplicationException(aexn)
12432 }
12433 };
12434
12435 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12436 "put",
12437 METHOD_NAME.as_cstr(),
12438 _seqid,
12439 req_ctxt,
12440 &mut ctx_stack,
12441 res
12442 )?;
12443 reply_state.lock().unwrap().send_reply(env);
12444 Ok(())
12445 }
12446
12447 #[::tracing::instrument(skip_all, name = "handler", fields(method = "GraphStorageService.remove"))]
12448 async fn handle_remove<'a>(
12449 &'a self,
12450 p: &'a mut P::Deserializer,
12451 req_ctxt: &R,
12452 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12453 _seqid: ::std::primitive::u32,
12454 ) -> ::anyhow::Result<()> {
12455 use ::const_cstr::const_cstr;
12456 use ::futures::FutureExt as _;
12457
12458 const_cstr! {
12459 SERVICE_NAME = "GraphStorageService";
12460 METHOD_NAME = "GraphStorageService.remove";
12461 }
12462 let mut ctx_stack = req_ctxt.get_context_stack(
12463 SERVICE_NAME.as_cstr(),
12464 METHOD_NAME.as_cstr(),
12465 )?;
12466 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
12467 let _args: self::Args_GraphStorageService_remove = ::fbthrift::Deserialize::read(p)?;
12468 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
12469 protocol: P::PROTOCOL_ID,
12470 method_name: METHOD_NAME.as_cstr(),
12471 buffer: ::std::marker::PhantomData, })?;
12473 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
12474
12475 let res = ::std::panic::AssertUnwindSafe(
12476 self.service.remove(
12477 _args.req,
12478 )
12479 )
12480 .catch_unwind()
12481 .await;
12482
12483 let res = match res {
12485 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
12486 ::tracing::info!("success");
12487 crate::services::graph_storage_service::RemoveExn::Success(res)
12488 }
12489 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::graph_storage_service::RemoveExn::Success(_))) => {
12490 panic!(
12491 "{} attempted to return success via error",
12492 "remove",
12493 )
12494 }
12495 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
12496 ::tracing::error!(exception = ?exn);
12497 exn
12498 }
12499 ::std::result::Result::Err(exn) => {
12500 let aexn = ::fbthrift::ApplicationException::handler_panic("GraphStorageService.remove", exn);
12501 crate::services::graph_storage_service::RemoveExn::ApplicationException(aexn)
12502 }
12503 };
12504
12505 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
12506 "remove",
12507 METHOD_NAME.as_cstr(),
12508 _seqid,
12509 req_ctxt,
12510 &mut ctx_stack,
12511 res
12512 )?;
12513 reply_state.lock().unwrap().send_reply(env);
12514 Ok(())
12515 }
12516 }
12517
12518 #[::async_trait::async_trait]
12519 impl<P, H, R, RS> ::fbthrift::ServiceProcessor<P> for GraphStorageServiceProcessor<P, H, R, RS>
12520 where
12521 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
12522 P::Deserializer: ::std::marker::Send,
12523 H: GraphStorageService,
12524 P::Frame: ::std::marker::Send + 'static,
12525 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
12526 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
12527 + ::std::marker::Send + ::std::marker::Sync + 'static,
12528 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
12529 {
12530 type RequestContext = R;
12531 type ReplyState = RS;
12532
12533 #[inline]
12534 fn method_idx(&self, name: &[::std::primitive::u8]) -> ::std::result::Result<::std::primitive::usize, ::fbthrift::ApplicationException> {
12535 match name {
12536 b"getNeighbors" => ::std::result::Result::Ok(0usize),
12537 b"getDstBySrc" => ::std::result::Result::Ok(1usize),
12538 b"getProps" => ::std::result::Result::Ok(2usize),
12539 b"addVertices" => ::std::result::Result::Ok(3usize),
12540 b"addEdges" => ::std::result::Result::Ok(4usize),
12541 b"deleteEdges" => ::std::result::Result::Ok(5usize),
12542 b"deleteVertices" => ::std::result::Result::Ok(6usize),
12543 b"deleteTags" => ::std::result::Result::Ok(7usize),
12544 b"updateVertex" => ::std::result::Result::Ok(8usize),
12545 b"updateEdge" => ::std::result::Result::Ok(9usize),
12546 b"scanVertex" => ::std::result::Result::Ok(10usize),
12547 b"scanEdge" => ::std::result::Result::Ok(11usize),
12548 b"getUUID" => ::std::result::Result::Ok(12usize),
12549 b"lookupIndex" => ::std::result::Result::Ok(13usize),
12550 b"lookupAndTraverse" => ::std::result::Result::Ok(14usize),
12551 b"chainUpdateEdge" => ::std::result::Result::Ok(15usize),
12552 b"chainAddEdges" => ::std::result::Result::Ok(16usize),
12553 b"chainDeleteEdges" => ::std::result::Result::Ok(17usize),
12554 b"get" => ::std::result::Result::Ok(18usize),
12555 b"put" => ::std::result::Result::Ok(19usize),
12556 b"remove" => ::std::result::Result::Ok(20usize),
12557 _ => ::std::result::Result::Err(::fbthrift::ApplicationException::unknown_method()),
12558 }
12559 }
12560
12561 #[allow(clippy::match_single_binding)]
12562 async fn handle_method(
12563 &self,
12564 idx: ::std::primitive::usize,
12565 _p: &mut P::Deserializer,
12566 _r: &R,
12567 _reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12568 _seqid: ::std::primitive::u32,
12569 ) -> ::anyhow::Result<()> {
12570 match idx {
12571 0usize => {
12572 self.handle_getNeighbors(_p, _r, _reply_state, _seqid).await
12573 }
12574 1usize => {
12575 self.handle_getDstBySrc(_p, _r, _reply_state, _seqid).await
12576 }
12577 2usize => {
12578 self.handle_getProps(_p, _r, _reply_state, _seqid).await
12579 }
12580 3usize => {
12581 self.handle_addVertices(_p, _r, _reply_state, _seqid).await
12582 }
12583 4usize => {
12584 self.handle_addEdges(_p, _r, _reply_state, _seqid).await
12585 }
12586 5usize => {
12587 self.handle_deleteEdges(_p, _r, _reply_state, _seqid).await
12588 }
12589 6usize => {
12590 self.handle_deleteVertices(_p, _r, _reply_state, _seqid).await
12591 }
12592 7usize => {
12593 self.handle_deleteTags(_p, _r, _reply_state, _seqid).await
12594 }
12595 8usize => {
12596 self.handle_updateVertex(_p, _r, _reply_state, _seqid).await
12597 }
12598 9usize => {
12599 self.handle_updateEdge(_p, _r, _reply_state, _seqid).await
12600 }
12601 10usize => {
12602 self.handle_scanVertex(_p, _r, _reply_state, _seqid).await
12603 }
12604 11usize => {
12605 self.handle_scanEdge(_p, _r, _reply_state, _seqid).await
12606 }
12607 12usize => {
12608 self.handle_getUUID(_p, _r, _reply_state, _seqid).await
12609 }
12610 13usize => {
12611 self.handle_lookupIndex(_p, _r, _reply_state, _seqid).await
12612 }
12613 14usize => {
12614 self.handle_lookupAndTraverse(_p, _r, _reply_state, _seqid).await
12615 }
12616 15usize => {
12617 self.handle_chainUpdateEdge(_p, _r, _reply_state, _seqid).await
12618 }
12619 16usize => {
12620 self.handle_chainAddEdges(_p, _r, _reply_state, _seqid).await
12621 }
12622 17usize => {
12623 self.handle_chainDeleteEdges(_p, _r, _reply_state, _seqid).await
12624 }
12625 18usize => {
12626 self.handle_get(_p, _r, _reply_state, _seqid).await
12627 }
12628 19usize => {
12629 self.handle_put(_p, _r, _reply_state, _seqid).await
12630 }
12631 20usize => {
12632 self.handle_remove(_p, _r, _reply_state, _seqid).await
12633 }
12634 bad => panic!(
12635 "{}: unexpected method idx {}",
12636 "GraphStorageServiceProcessor",
12637 bad
12638 ),
12639 }
12640 }
12641
12642 #[allow(clippy::match_single_binding)]
12643 #[inline]
12644 fn create_interaction_idx(&self, name: &str) -> ::anyhow::Result<::std::primitive::usize> {
12645 match name {
12646 _ => ::anyhow::bail!("Unknown interaction"),
12647 }
12648 }
12649
12650 #[allow(clippy::match_single_binding)]
12651 fn handle_create_interaction(
12652 &self,
12653 idx: ::std::primitive::usize,
12654 ) -> ::anyhow::Result<
12655 ::std::sync::Arc<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = Self::RequestContext, ReplyState = Self::ReplyState> + ::std::marker::Send + 'static>
12656 > {
12657 match idx {
12658 bad => panic!(
12659 "{}: unexpected method idx {}",
12660 "GraphStorageServiceProcessor",
12661 bad
12662 ),
12663 }
12664 }
12665 }
12666
12667 #[::async_trait::async_trait]
12668 impl<P, H, R, RS> ::fbthrift::ThriftService<P::Frame> for GraphStorageServiceProcessor<P, H, R, RS>
12669 where
12670 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
12671 P::Deserializer: ::std::marker::Send,
12672 P::Frame: ::std::marker::Send + 'static,
12673 H: GraphStorageService,
12674 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
12675 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
12676 + ::std::marker::Send + ::std::marker::Sync + 'static,
12677 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
12678 {
12679 type Handler = H;
12680 type RequestContext = R;
12681 type ReplyState = RS;
12682
12683 #[tracing::instrument(level="trace", skip_all, fields(service = "GraphStorageService"))]
12684 async fn call(
12685 &self,
12686 req: ::fbthrift::ProtocolDecoded<P>,
12687 req_ctxt: &R,
12688 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
12689 ) -> ::anyhow::Result<()> {
12690 use ::fbthrift::{BufExt as _, ProtocolReader as _, ServiceProcessor as _};
12691 let mut p = P::deserializer(req);
12692 let (idx, mty, seqid) = p.read_message_begin(|name| self.method_idx(name))?;
12693 if mty != ::fbthrift::MessageType::Call {
12694 return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
12695 ::fbthrift::ApplicationExceptionErrorCode::InvalidMessageType,
12696 format!("message type {:?} not handled", mty)
12697 )));
12698 }
12699 let idx = match idx {
12700 ::std::result::Result::Ok(idx) => idx,
12701 ::std::result::Result::Err(_) => {
12702 let cur = P::into_buffer(p).reset();
12703 return self.supa.call(cur, req_ctxt, reply_state).await;
12704 }
12705 };
12706 self.handle_method(idx, &mut p, req_ctxt, reply_state, seqid).await?;
12707 p.read_message_end()?;
12708
12709 Ok(())
12710 }
12711
12712 fn create_interaction(
12713 &self,
12714 name: &str,
12715 ) -> ::anyhow::Result<
12716 ::std::sync::Arc<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>
12717 > {
12718 use ::fbthrift::{ServiceProcessor as _};
12719 let idx = self.create_interaction_idx(name);
12720 let idx = match idx {
12721 ::anyhow::Result::Ok(idx) => idx,
12722 ::anyhow::Result::Err(_) => {
12723 return self.supa.create_interaction(name);
12724 }
12725 };
12726 self.handle_create_interaction(idx)
12727 }
12728
12729 fn get_method_names(&self) -> &'static [&'static str] {
12730 &[
12731 "getNeighbors",
12733 "getDstBySrc",
12734 "getProps",
12735 "addVertices",
12736 "addEdges",
12737 "deleteEdges",
12738 "deleteVertices",
12739 "deleteTags",
12740 "updateVertex",
12741 "updateEdge",
12742 "scanVertex",
12743 "scanEdge",
12744 "getUUID",
12745 "lookupIndex",
12746 "lookupAndTraverse",
12747 "chainUpdateEdge",
12748 "chainAddEdges",
12749 "chainDeleteEdges",
12750 "get",
12751 "put",
12752 "remove",
12753 ]
12754 }
12755 }
12756
12757 #[::tracing::instrument(level="debug", skip_all, fields(proto = ?proto))]
12762 pub fn make_GraphStorageService_server<F, H, R, RS>(
12763 proto: ::fbthrift::ProtocolID,
12764 handler: H,
12765 ) -> ::std::result::Result<::std::boxed::Box<dyn ::fbthrift::ThriftService<F, Handler = H, RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>, ::fbthrift::ApplicationException>
12766 where
12767 F: ::fbthrift::Framing + ::std::marker::Send + ::std::marker::Sync + 'static,
12768 H: GraphStorageService,
12769 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
12770 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = F::DecBuf> + ::std::marker::Send + ::std::marker::Sync + 'static,
12771 RS: ::fbthrift::ReplyState<F, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
12772 {
12773 match proto {
12774 ::fbthrift::ProtocolID::BinaryProtocol => {
12775 ::std::result::Result::Ok(::std::boxed::Box::new(GraphStorageServiceProcessor::<::fbthrift::BinaryProtocol<F>, H, R, RS>::new(handler)))
12776 }
12777 ::fbthrift::ProtocolID::CompactProtocol => {
12778 ::std::result::Result::Ok(::std::boxed::Box::new(GraphStorageServiceProcessor::<::fbthrift::CompactProtocol<F>, H, R, RS>::new(handler)))
12779 }
12780 bad => {
12781 ::tracing::error!(method = "GraphStorageService.", invalid_protocol = ?bad);
12782 ::std::result::Result::Err(::fbthrift::ApplicationException::invalid_protocol(bad))
12783 }
12784 }
12785 }
12786
12787 #[::async_trait::async_trait]
12788 pub trait StorageAdminService: ::std::marker::Send + ::std::marker::Sync + 'static {
12789 async fn transLeader(
12790 &self,
12791 _req: crate::types::TransLeaderReq,
12792 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::TransLeaderExn> {
12793 ::std::result::Result::Err(crate::services::storage_admin_service::TransLeaderExn::ApplicationException(
12794 ::fbthrift::ApplicationException::unimplemented_method(
12795 "StorageAdminService",
12796 "transLeader",
12797 ),
12798 ))
12799 }
12800 async fn addPart(
12801 &self,
12802 _req: crate::types::AddPartReq,
12803 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::AddPartExn> {
12804 ::std::result::Result::Err(crate::services::storage_admin_service::AddPartExn::ApplicationException(
12805 ::fbthrift::ApplicationException::unimplemented_method(
12806 "StorageAdminService",
12807 "addPart",
12808 ),
12809 ))
12810 }
12811 async fn addLearner(
12812 &self,
12813 _req: crate::types::AddLearnerReq,
12814 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::AddLearnerExn> {
12815 ::std::result::Result::Err(crate::services::storage_admin_service::AddLearnerExn::ApplicationException(
12816 ::fbthrift::ApplicationException::unimplemented_method(
12817 "StorageAdminService",
12818 "addLearner",
12819 ),
12820 ))
12821 }
12822 async fn removePart(
12823 &self,
12824 _req: crate::types::RemovePartReq,
12825 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::RemovePartExn> {
12826 ::std::result::Result::Err(crate::services::storage_admin_service::RemovePartExn::ApplicationException(
12827 ::fbthrift::ApplicationException::unimplemented_method(
12828 "StorageAdminService",
12829 "removePart",
12830 ),
12831 ))
12832 }
12833 async fn memberChange(
12834 &self,
12835 _req: crate::types::MemberChangeReq,
12836 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::MemberChangeExn> {
12837 ::std::result::Result::Err(crate::services::storage_admin_service::MemberChangeExn::ApplicationException(
12838 ::fbthrift::ApplicationException::unimplemented_method(
12839 "StorageAdminService",
12840 "memberChange",
12841 ),
12842 ))
12843 }
12844 async fn waitingForCatchUpData(
12845 &self,
12846 _req: crate::types::CatchUpDataReq,
12847 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::WaitingForCatchUpDataExn> {
12848 ::std::result::Result::Err(crate::services::storage_admin_service::WaitingForCatchUpDataExn::ApplicationException(
12849 ::fbthrift::ApplicationException::unimplemented_method(
12850 "StorageAdminService",
12851 "waitingForCatchUpData",
12852 ),
12853 ))
12854 }
12855 async fn createCheckpoint(
12856 &self,
12857 _req: crate::types::CreateCPRequest,
12858 ) -> ::std::result::Result<crate::types::CreateCPResp, crate::services::storage_admin_service::CreateCheckpointExn> {
12859 ::std::result::Result::Err(crate::services::storage_admin_service::CreateCheckpointExn::ApplicationException(
12860 ::fbthrift::ApplicationException::unimplemented_method(
12861 "StorageAdminService",
12862 "createCheckpoint",
12863 ),
12864 ))
12865 }
12866 async fn dropCheckpoint(
12867 &self,
12868 _req: crate::types::DropCPRequest,
12869 ) -> ::std::result::Result<crate::types::DropCPResp, crate::services::storage_admin_service::DropCheckpointExn> {
12870 ::std::result::Result::Err(crate::services::storage_admin_service::DropCheckpointExn::ApplicationException(
12871 ::fbthrift::ApplicationException::unimplemented_method(
12872 "StorageAdminService",
12873 "dropCheckpoint",
12874 ),
12875 ))
12876 }
12877 async fn blockingWrites(
12878 &self,
12879 _req: crate::types::BlockingSignRequest,
12880 ) -> ::std::result::Result<crate::types::BlockingSignResp, crate::services::storage_admin_service::BlockingWritesExn> {
12881 ::std::result::Result::Err(crate::services::storage_admin_service::BlockingWritesExn::ApplicationException(
12882 ::fbthrift::ApplicationException::unimplemented_method(
12883 "StorageAdminService",
12884 "blockingWrites",
12885 ),
12886 ))
12887 }
12888 async fn getLeaderParts(
12889 &self,
12890 _req: crate::types::GetLeaderReq,
12891 ) -> ::std::result::Result<crate::types::GetLeaderPartsResp, crate::services::storage_admin_service::GetLeaderPartsExn> {
12892 ::std::result::Result::Err(crate::services::storage_admin_service::GetLeaderPartsExn::ApplicationException(
12893 ::fbthrift::ApplicationException::unimplemented_method(
12894 "StorageAdminService",
12895 "getLeaderParts",
12896 ),
12897 ))
12898 }
12899 async fn checkPeers(
12900 &self,
12901 _req: crate::types::CheckPeersReq,
12902 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::CheckPeersExn> {
12903 ::std::result::Result::Err(crate::services::storage_admin_service::CheckPeersExn::ApplicationException(
12904 ::fbthrift::ApplicationException::unimplemented_method(
12905 "StorageAdminService",
12906 "checkPeers",
12907 ),
12908 ))
12909 }
12910 async fn addAdminTask(
12911 &self,
12912 _req: crate::types::AddTaskRequest,
12913 ) -> ::std::result::Result<crate::types::AddTaskResp, crate::services::storage_admin_service::AddAdminTaskExn> {
12914 ::std::result::Result::Err(crate::services::storage_admin_service::AddAdminTaskExn::ApplicationException(
12915 ::fbthrift::ApplicationException::unimplemented_method(
12916 "StorageAdminService",
12917 "addAdminTask",
12918 ),
12919 ))
12920 }
12921 async fn stopAdminTask(
12922 &self,
12923 _req: crate::types::StopTaskRequest,
12924 ) -> ::std::result::Result<crate::types::StopTaskResp, crate::services::storage_admin_service::StopAdminTaskExn> {
12925 ::std::result::Result::Err(crate::services::storage_admin_service::StopAdminTaskExn::ApplicationException(
12926 ::fbthrift::ApplicationException::unimplemented_method(
12927 "StorageAdminService",
12928 "stopAdminTask",
12929 ),
12930 ))
12931 }
12932 async fn clearSpace(
12933 &self,
12934 _req: crate::types::ClearSpaceReq,
12935 ) -> ::std::result::Result<crate::types::ClearSpaceResp, crate::services::storage_admin_service::ClearSpaceExn> {
12936 ::std::result::Result::Err(crate::services::storage_admin_service::ClearSpaceExn::ApplicationException(
12937 ::fbthrift::ApplicationException::unimplemented_method(
12938 "StorageAdminService",
12939 "clearSpace",
12940 ),
12941 ))
12942 }
12943 }
12944
12945 #[::async_trait::async_trait]
12946 impl<T> StorageAdminService for ::std::boxed::Box<T>
12947 where
12948 T: StorageAdminService + Send + Sync + ?Sized,
12949 {
12950 async fn transLeader(
12951 &self,
12952 req: crate::types::TransLeaderReq,
12953 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::TransLeaderExn> {
12954 (**self).transLeader(
12955 req,
12956 ).await
12957 }
12958 async fn addPart(
12959 &self,
12960 req: crate::types::AddPartReq,
12961 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::AddPartExn> {
12962 (**self).addPart(
12963 req,
12964 ).await
12965 }
12966 async fn addLearner(
12967 &self,
12968 req: crate::types::AddLearnerReq,
12969 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::AddLearnerExn> {
12970 (**self).addLearner(
12971 req,
12972 ).await
12973 }
12974 async fn removePart(
12975 &self,
12976 req: crate::types::RemovePartReq,
12977 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::RemovePartExn> {
12978 (**self).removePart(
12979 req,
12980 ).await
12981 }
12982 async fn memberChange(
12983 &self,
12984 req: crate::types::MemberChangeReq,
12985 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::MemberChangeExn> {
12986 (**self).memberChange(
12987 req,
12988 ).await
12989 }
12990 async fn waitingForCatchUpData(
12991 &self,
12992 req: crate::types::CatchUpDataReq,
12993 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::WaitingForCatchUpDataExn> {
12994 (**self).waitingForCatchUpData(
12995 req,
12996 ).await
12997 }
12998 async fn createCheckpoint(
12999 &self,
13000 req: crate::types::CreateCPRequest,
13001 ) -> ::std::result::Result<crate::types::CreateCPResp, crate::services::storage_admin_service::CreateCheckpointExn> {
13002 (**self).createCheckpoint(
13003 req,
13004 ).await
13005 }
13006 async fn dropCheckpoint(
13007 &self,
13008 req: crate::types::DropCPRequest,
13009 ) -> ::std::result::Result<crate::types::DropCPResp, crate::services::storage_admin_service::DropCheckpointExn> {
13010 (**self).dropCheckpoint(
13011 req,
13012 ).await
13013 }
13014 async fn blockingWrites(
13015 &self,
13016 req: crate::types::BlockingSignRequest,
13017 ) -> ::std::result::Result<crate::types::BlockingSignResp, crate::services::storage_admin_service::BlockingWritesExn> {
13018 (**self).blockingWrites(
13019 req,
13020 ).await
13021 }
13022 async fn getLeaderParts(
13023 &self,
13024 req: crate::types::GetLeaderReq,
13025 ) -> ::std::result::Result<crate::types::GetLeaderPartsResp, crate::services::storage_admin_service::GetLeaderPartsExn> {
13026 (**self).getLeaderParts(
13027 req,
13028 ).await
13029 }
13030 async fn checkPeers(
13031 &self,
13032 req: crate::types::CheckPeersReq,
13033 ) -> ::std::result::Result<crate::types::AdminExecResp, crate::services::storage_admin_service::CheckPeersExn> {
13034 (**self).checkPeers(
13035 req,
13036 ).await
13037 }
13038 async fn addAdminTask(
13039 &self,
13040 req: crate::types::AddTaskRequest,
13041 ) -> ::std::result::Result<crate::types::AddTaskResp, crate::services::storage_admin_service::AddAdminTaskExn> {
13042 (**self).addAdminTask(
13043 req,
13044 ).await
13045 }
13046 async fn stopAdminTask(
13047 &self,
13048 req: crate::types::StopTaskRequest,
13049 ) -> ::std::result::Result<crate::types::StopTaskResp, crate::services::storage_admin_service::StopAdminTaskExn> {
13050 (**self).stopAdminTask(
13051 req,
13052 ).await
13053 }
13054 async fn clearSpace(
13055 &self,
13056 req: crate::types::ClearSpaceReq,
13057 ) -> ::std::result::Result<crate::types::ClearSpaceResp, crate::services::storage_admin_service::ClearSpaceExn> {
13058 (**self).clearSpace(
13059 req,
13060 ).await
13061 }
13062 }
13063
13064 #[derive(Clone, Debug)]
13066 pub struct StorageAdminServiceProcessor<P, H, R, RS> {
13067 service: H,
13068 supa: ::fbthrift::NullServiceProcessor<P, R, RS>,
13069 _phantom: ::std::marker::PhantomData<(P, H, R, RS)>,
13070 }
13071
13072 struct Args_StorageAdminService_transLeader {
13073 req: crate::types::TransLeaderReq,
13074 }
13075 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_transLeader {
13076 #[inline]
13077 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.transLeader"))]
13078 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13079 static ARGS: &[::fbthrift::Field] = &[
13080 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13081 ];
13082 let mut field_req = ::std::option::Option::None;
13083 let _ = p.read_struct_begin(|_| ())?;
13084 loop {
13085 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13086 match (fty, fid as ::std::primitive::i32) {
13087 (::fbthrift::TType::Stop, _) => break,
13088 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13089 (fty, _) => p.skip(fty)?,
13090 }
13091 p.read_field_end()?;
13092 }
13093 p.read_struct_end()?;
13094 ::std::result::Result::Ok(Self {
13095 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.transLeader", "req"))?,
13096 })
13097 }
13098 }
13099
13100 struct Args_StorageAdminService_addPart {
13101 req: crate::types::AddPartReq,
13102 }
13103 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_addPart {
13104 #[inline]
13105 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.addPart"))]
13106 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13107 static ARGS: &[::fbthrift::Field] = &[
13108 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13109 ];
13110 let mut field_req = ::std::option::Option::None;
13111 let _ = p.read_struct_begin(|_| ())?;
13112 loop {
13113 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13114 match (fty, fid as ::std::primitive::i32) {
13115 (::fbthrift::TType::Stop, _) => break,
13116 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13117 (fty, _) => p.skip(fty)?,
13118 }
13119 p.read_field_end()?;
13120 }
13121 p.read_struct_end()?;
13122 ::std::result::Result::Ok(Self {
13123 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.addPart", "req"))?,
13124 })
13125 }
13126 }
13127
13128 struct Args_StorageAdminService_addLearner {
13129 req: crate::types::AddLearnerReq,
13130 }
13131 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_addLearner {
13132 #[inline]
13133 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.addLearner"))]
13134 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13135 static ARGS: &[::fbthrift::Field] = &[
13136 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13137 ];
13138 let mut field_req = ::std::option::Option::None;
13139 let _ = p.read_struct_begin(|_| ())?;
13140 loop {
13141 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13142 match (fty, fid as ::std::primitive::i32) {
13143 (::fbthrift::TType::Stop, _) => break,
13144 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13145 (fty, _) => p.skip(fty)?,
13146 }
13147 p.read_field_end()?;
13148 }
13149 p.read_struct_end()?;
13150 ::std::result::Result::Ok(Self {
13151 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.addLearner", "req"))?,
13152 })
13153 }
13154 }
13155
13156 struct Args_StorageAdminService_removePart {
13157 req: crate::types::RemovePartReq,
13158 }
13159 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_removePart {
13160 #[inline]
13161 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.removePart"))]
13162 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13163 static ARGS: &[::fbthrift::Field] = &[
13164 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13165 ];
13166 let mut field_req = ::std::option::Option::None;
13167 let _ = p.read_struct_begin(|_| ())?;
13168 loop {
13169 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13170 match (fty, fid as ::std::primitive::i32) {
13171 (::fbthrift::TType::Stop, _) => break,
13172 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13173 (fty, _) => p.skip(fty)?,
13174 }
13175 p.read_field_end()?;
13176 }
13177 p.read_struct_end()?;
13178 ::std::result::Result::Ok(Self {
13179 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.removePart", "req"))?,
13180 })
13181 }
13182 }
13183
13184 struct Args_StorageAdminService_memberChange {
13185 req: crate::types::MemberChangeReq,
13186 }
13187 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_memberChange {
13188 #[inline]
13189 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.memberChange"))]
13190 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13191 static ARGS: &[::fbthrift::Field] = &[
13192 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13193 ];
13194 let mut field_req = ::std::option::Option::None;
13195 let _ = p.read_struct_begin(|_| ())?;
13196 loop {
13197 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13198 match (fty, fid as ::std::primitive::i32) {
13199 (::fbthrift::TType::Stop, _) => break,
13200 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13201 (fty, _) => p.skip(fty)?,
13202 }
13203 p.read_field_end()?;
13204 }
13205 p.read_struct_end()?;
13206 ::std::result::Result::Ok(Self {
13207 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.memberChange", "req"))?,
13208 })
13209 }
13210 }
13211
13212 struct Args_StorageAdminService_waitingForCatchUpData {
13213 req: crate::types::CatchUpDataReq,
13214 }
13215 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_waitingForCatchUpData {
13216 #[inline]
13217 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.waitingForCatchUpData"))]
13218 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13219 static ARGS: &[::fbthrift::Field] = &[
13220 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13221 ];
13222 let mut field_req = ::std::option::Option::None;
13223 let _ = p.read_struct_begin(|_| ())?;
13224 loop {
13225 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13226 match (fty, fid as ::std::primitive::i32) {
13227 (::fbthrift::TType::Stop, _) => break,
13228 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13229 (fty, _) => p.skip(fty)?,
13230 }
13231 p.read_field_end()?;
13232 }
13233 p.read_struct_end()?;
13234 ::std::result::Result::Ok(Self {
13235 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.waitingForCatchUpData", "req"))?,
13236 })
13237 }
13238 }
13239
13240 struct Args_StorageAdminService_createCheckpoint {
13241 req: crate::types::CreateCPRequest,
13242 }
13243 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_createCheckpoint {
13244 #[inline]
13245 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.createCheckpoint"))]
13246 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13247 static ARGS: &[::fbthrift::Field] = &[
13248 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13249 ];
13250 let mut field_req = ::std::option::Option::None;
13251 let _ = p.read_struct_begin(|_| ())?;
13252 loop {
13253 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13254 match (fty, fid as ::std::primitive::i32) {
13255 (::fbthrift::TType::Stop, _) => break,
13256 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13257 (fty, _) => p.skip(fty)?,
13258 }
13259 p.read_field_end()?;
13260 }
13261 p.read_struct_end()?;
13262 ::std::result::Result::Ok(Self {
13263 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.createCheckpoint", "req"))?,
13264 })
13265 }
13266 }
13267
13268 struct Args_StorageAdminService_dropCheckpoint {
13269 req: crate::types::DropCPRequest,
13270 }
13271 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_dropCheckpoint {
13272 #[inline]
13273 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.dropCheckpoint"))]
13274 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13275 static ARGS: &[::fbthrift::Field] = &[
13276 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13277 ];
13278 let mut field_req = ::std::option::Option::None;
13279 let _ = p.read_struct_begin(|_| ())?;
13280 loop {
13281 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13282 match (fty, fid as ::std::primitive::i32) {
13283 (::fbthrift::TType::Stop, _) => break,
13284 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13285 (fty, _) => p.skip(fty)?,
13286 }
13287 p.read_field_end()?;
13288 }
13289 p.read_struct_end()?;
13290 ::std::result::Result::Ok(Self {
13291 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.dropCheckpoint", "req"))?,
13292 })
13293 }
13294 }
13295
13296 struct Args_StorageAdminService_blockingWrites {
13297 req: crate::types::BlockingSignRequest,
13298 }
13299 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_blockingWrites {
13300 #[inline]
13301 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.blockingWrites"))]
13302 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13303 static ARGS: &[::fbthrift::Field] = &[
13304 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13305 ];
13306 let mut field_req = ::std::option::Option::None;
13307 let _ = p.read_struct_begin(|_| ())?;
13308 loop {
13309 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13310 match (fty, fid as ::std::primitive::i32) {
13311 (::fbthrift::TType::Stop, _) => break,
13312 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13313 (fty, _) => p.skip(fty)?,
13314 }
13315 p.read_field_end()?;
13316 }
13317 p.read_struct_end()?;
13318 ::std::result::Result::Ok(Self {
13319 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.blockingWrites", "req"))?,
13320 })
13321 }
13322 }
13323
13324 struct Args_StorageAdminService_getLeaderParts {
13325 req: crate::types::GetLeaderReq,
13326 }
13327 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_getLeaderParts {
13328 #[inline]
13329 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.getLeaderParts"))]
13330 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13331 static ARGS: &[::fbthrift::Field] = &[
13332 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13333 ];
13334 let mut field_req = ::std::option::Option::None;
13335 let _ = p.read_struct_begin(|_| ())?;
13336 loop {
13337 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13338 match (fty, fid as ::std::primitive::i32) {
13339 (::fbthrift::TType::Stop, _) => break,
13340 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13341 (fty, _) => p.skip(fty)?,
13342 }
13343 p.read_field_end()?;
13344 }
13345 p.read_struct_end()?;
13346 ::std::result::Result::Ok(Self {
13347 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.getLeaderParts", "req"))?,
13348 })
13349 }
13350 }
13351
13352 struct Args_StorageAdminService_checkPeers {
13353 req: crate::types::CheckPeersReq,
13354 }
13355 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_checkPeers {
13356 #[inline]
13357 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.checkPeers"))]
13358 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13359 static ARGS: &[::fbthrift::Field] = &[
13360 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13361 ];
13362 let mut field_req = ::std::option::Option::None;
13363 let _ = p.read_struct_begin(|_| ())?;
13364 loop {
13365 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13366 match (fty, fid as ::std::primitive::i32) {
13367 (::fbthrift::TType::Stop, _) => break,
13368 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13369 (fty, _) => p.skip(fty)?,
13370 }
13371 p.read_field_end()?;
13372 }
13373 p.read_struct_end()?;
13374 ::std::result::Result::Ok(Self {
13375 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.checkPeers", "req"))?,
13376 })
13377 }
13378 }
13379
13380 struct Args_StorageAdminService_addAdminTask {
13381 req: crate::types::AddTaskRequest,
13382 }
13383 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_addAdminTask {
13384 #[inline]
13385 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.addAdminTask"))]
13386 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13387 static ARGS: &[::fbthrift::Field] = &[
13388 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13389 ];
13390 let mut field_req = ::std::option::Option::None;
13391 let _ = p.read_struct_begin(|_| ())?;
13392 loop {
13393 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13394 match (fty, fid as ::std::primitive::i32) {
13395 (::fbthrift::TType::Stop, _) => break,
13396 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13397 (fty, _) => p.skip(fty)?,
13398 }
13399 p.read_field_end()?;
13400 }
13401 p.read_struct_end()?;
13402 ::std::result::Result::Ok(Self {
13403 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.addAdminTask", "req"))?,
13404 })
13405 }
13406 }
13407
13408 struct Args_StorageAdminService_stopAdminTask {
13409 req: crate::types::StopTaskRequest,
13410 }
13411 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_stopAdminTask {
13412 #[inline]
13413 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.stopAdminTask"))]
13414 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13415 static ARGS: &[::fbthrift::Field] = &[
13416 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13417 ];
13418 let mut field_req = ::std::option::Option::None;
13419 let _ = p.read_struct_begin(|_| ())?;
13420 loop {
13421 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13422 match (fty, fid as ::std::primitive::i32) {
13423 (::fbthrift::TType::Stop, _) => break,
13424 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13425 (fty, _) => p.skip(fty)?,
13426 }
13427 p.read_field_end()?;
13428 }
13429 p.read_struct_end()?;
13430 ::std::result::Result::Ok(Self {
13431 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.stopAdminTask", "req"))?,
13432 })
13433 }
13434 }
13435
13436 struct Args_StorageAdminService_clearSpace {
13437 req: crate::types::ClearSpaceReq,
13438 }
13439 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_StorageAdminService_clearSpace {
13440 #[inline]
13441 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "StorageAdminService.clearSpace"))]
13442 fn read(p: &mut P) -> ::anyhow::Result<Self> {
13443 static ARGS: &[::fbthrift::Field] = &[
13444 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
13445 ];
13446 let mut field_req = ::std::option::Option::None;
13447 let _ = p.read_struct_begin(|_| ())?;
13448 loop {
13449 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
13450 match (fty, fid as ::std::primitive::i32) {
13451 (::fbthrift::TType::Stop, _) => break,
13452 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
13453 (fty, _) => p.skip(fty)?,
13454 }
13455 p.read_field_end()?;
13456 }
13457 p.read_struct_end()?;
13458 ::std::result::Result::Ok(Self {
13459 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "StorageAdminService.clearSpace", "req"))?,
13460 })
13461 }
13462 }
13463
13464
13465 impl<P, H, R, RS> StorageAdminServiceProcessor<P, H, R, RS>
13466 where
13467 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
13468 P::Frame: ::std::marker::Send + 'static,
13469 P::Deserializer: ::std::marker::Send,
13470 H: StorageAdminService,
13471 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
13472 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
13473 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
13474 + ::std::marker::Send + ::std::marker::Sync,
13475 {
13476 pub fn new(service: H) -> Self {
13477 Self {
13478 service,
13479 supa: ::fbthrift::NullServiceProcessor::new(),
13480 _phantom: ::std::marker::PhantomData,
13481 }
13482 }
13483
13484 pub fn into_inner(self) -> H {
13485 self.service
13486 }
13487
13488 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.transLeader"))]
13489 async fn handle_transLeader<'a>(
13490 &'a self,
13491 p: &'a mut P::Deserializer,
13492 req_ctxt: &R,
13493 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13494 _seqid: ::std::primitive::u32,
13495 ) -> ::anyhow::Result<()> {
13496 use ::const_cstr::const_cstr;
13497 use ::futures::FutureExt as _;
13498
13499 const_cstr! {
13500 SERVICE_NAME = "StorageAdminService";
13501 METHOD_NAME = "StorageAdminService.transLeader";
13502 }
13503 let mut ctx_stack = req_ctxt.get_context_stack(
13504 SERVICE_NAME.as_cstr(),
13505 METHOD_NAME.as_cstr(),
13506 )?;
13507 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13508 let _args: self::Args_StorageAdminService_transLeader = ::fbthrift::Deserialize::read(p)?;
13509 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13510 protocol: P::PROTOCOL_ID,
13511 method_name: METHOD_NAME.as_cstr(),
13512 buffer: ::std::marker::PhantomData, })?;
13514 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13515
13516 let res = ::std::panic::AssertUnwindSafe(
13517 self.service.transLeader(
13518 _args.req,
13519 )
13520 )
13521 .catch_unwind()
13522 .await;
13523
13524 let res = match res {
13526 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13527 ::tracing::info!("success");
13528 crate::services::storage_admin_service::TransLeaderExn::Success(res)
13529 }
13530 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::TransLeaderExn::Success(_))) => {
13531 panic!(
13532 "{} attempted to return success via error",
13533 "transLeader",
13534 )
13535 }
13536 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13537 ::tracing::error!(exception = ?exn);
13538 exn
13539 }
13540 ::std::result::Result::Err(exn) => {
13541 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.transLeader", exn);
13542 crate::services::storage_admin_service::TransLeaderExn::ApplicationException(aexn)
13543 }
13544 };
13545
13546 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13547 "transLeader",
13548 METHOD_NAME.as_cstr(),
13549 _seqid,
13550 req_ctxt,
13551 &mut ctx_stack,
13552 res
13553 )?;
13554 reply_state.lock().unwrap().send_reply(env);
13555 Ok(())
13556 }
13557
13558 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.addPart"))]
13559 async fn handle_addPart<'a>(
13560 &'a self,
13561 p: &'a mut P::Deserializer,
13562 req_ctxt: &R,
13563 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13564 _seqid: ::std::primitive::u32,
13565 ) -> ::anyhow::Result<()> {
13566 use ::const_cstr::const_cstr;
13567 use ::futures::FutureExt as _;
13568
13569 const_cstr! {
13570 SERVICE_NAME = "StorageAdminService";
13571 METHOD_NAME = "StorageAdminService.addPart";
13572 }
13573 let mut ctx_stack = req_ctxt.get_context_stack(
13574 SERVICE_NAME.as_cstr(),
13575 METHOD_NAME.as_cstr(),
13576 )?;
13577 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13578 let _args: self::Args_StorageAdminService_addPart = ::fbthrift::Deserialize::read(p)?;
13579 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13580 protocol: P::PROTOCOL_ID,
13581 method_name: METHOD_NAME.as_cstr(),
13582 buffer: ::std::marker::PhantomData, })?;
13584 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13585
13586 let res = ::std::panic::AssertUnwindSafe(
13587 self.service.addPart(
13588 _args.req,
13589 )
13590 )
13591 .catch_unwind()
13592 .await;
13593
13594 let res = match res {
13596 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13597 ::tracing::info!("success");
13598 crate::services::storage_admin_service::AddPartExn::Success(res)
13599 }
13600 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::AddPartExn::Success(_))) => {
13601 panic!(
13602 "{} attempted to return success via error",
13603 "addPart",
13604 )
13605 }
13606 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13607 ::tracing::error!(exception = ?exn);
13608 exn
13609 }
13610 ::std::result::Result::Err(exn) => {
13611 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.addPart", exn);
13612 crate::services::storage_admin_service::AddPartExn::ApplicationException(aexn)
13613 }
13614 };
13615
13616 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13617 "addPart",
13618 METHOD_NAME.as_cstr(),
13619 _seqid,
13620 req_ctxt,
13621 &mut ctx_stack,
13622 res
13623 )?;
13624 reply_state.lock().unwrap().send_reply(env);
13625 Ok(())
13626 }
13627
13628 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.addLearner"))]
13629 async fn handle_addLearner<'a>(
13630 &'a self,
13631 p: &'a mut P::Deserializer,
13632 req_ctxt: &R,
13633 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13634 _seqid: ::std::primitive::u32,
13635 ) -> ::anyhow::Result<()> {
13636 use ::const_cstr::const_cstr;
13637 use ::futures::FutureExt as _;
13638
13639 const_cstr! {
13640 SERVICE_NAME = "StorageAdminService";
13641 METHOD_NAME = "StorageAdminService.addLearner";
13642 }
13643 let mut ctx_stack = req_ctxt.get_context_stack(
13644 SERVICE_NAME.as_cstr(),
13645 METHOD_NAME.as_cstr(),
13646 )?;
13647 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13648 let _args: self::Args_StorageAdminService_addLearner = ::fbthrift::Deserialize::read(p)?;
13649 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13650 protocol: P::PROTOCOL_ID,
13651 method_name: METHOD_NAME.as_cstr(),
13652 buffer: ::std::marker::PhantomData, })?;
13654 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13655
13656 let res = ::std::panic::AssertUnwindSafe(
13657 self.service.addLearner(
13658 _args.req,
13659 )
13660 )
13661 .catch_unwind()
13662 .await;
13663
13664 let res = match res {
13666 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13667 ::tracing::info!("success");
13668 crate::services::storage_admin_service::AddLearnerExn::Success(res)
13669 }
13670 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::AddLearnerExn::Success(_))) => {
13671 panic!(
13672 "{} attempted to return success via error",
13673 "addLearner",
13674 )
13675 }
13676 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13677 ::tracing::error!(exception = ?exn);
13678 exn
13679 }
13680 ::std::result::Result::Err(exn) => {
13681 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.addLearner", exn);
13682 crate::services::storage_admin_service::AddLearnerExn::ApplicationException(aexn)
13683 }
13684 };
13685
13686 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13687 "addLearner",
13688 METHOD_NAME.as_cstr(),
13689 _seqid,
13690 req_ctxt,
13691 &mut ctx_stack,
13692 res
13693 )?;
13694 reply_state.lock().unwrap().send_reply(env);
13695 Ok(())
13696 }
13697
13698 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.removePart"))]
13699 async fn handle_removePart<'a>(
13700 &'a self,
13701 p: &'a mut P::Deserializer,
13702 req_ctxt: &R,
13703 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13704 _seqid: ::std::primitive::u32,
13705 ) -> ::anyhow::Result<()> {
13706 use ::const_cstr::const_cstr;
13707 use ::futures::FutureExt as _;
13708
13709 const_cstr! {
13710 SERVICE_NAME = "StorageAdminService";
13711 METHOD_NAME = "StorageAdminService.removePart";
13712 }
13713 let mut ctx_stack = req_ctxt.get_context_stack(
13714 SERVICE_NAME.as_cstr(),
13715 METHOD_NAME.as_cstr(),
13716 )?;
13717 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13718 let _args: self::Args_StorageAdminService_removePart = ::fbthrift::Deserialize::read(p)?;
13719 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13720 protocol: P::PROTOCOL_ID,
13721 method_name: METHOD_NAME.as_cstr(),
13722 buffer: ::std::marker::PhantomData, })?;
13724 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13725
13726 let res = ::std::panic::AssertUnwindSafe(
13727 self.service.removePart(
13728 _args.req,
13729 )
13730 )
13731 .catch_unwind()
13732 .await;
13733
13734 let res = match res {
13736 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13737 ::tracing::info!("success");
13738 crate::services::storage_admin_service::RemovePartExn::Success(res)
13739 }
13740 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::RemovePartExn::Success(_))) => {
13741 panic!(
13742 "{} attempted to return success via error",
13743 "removePart",
13744 )
13745 }
13746 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13747 ::tracing::error!(exception = ?exn);
13748 exn
13749 }
13750 ::std::result::Result::Err(exn) => {
13751 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.removePart", exn);
13752 crate::services::storage_admin_service::RemovePartExn::ApplicationException(aexn)
13753 }
13754 };
13755
13756 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13757 "removePart",
13758 METHOD_NAME.as_cstr(),
13759 _seqid,
13760 req_ctxt,
13761 &mut ctx_stack,
13762 res
13763 )?;
13764 reply_state.lock().unwrap().send_reply(env);
13765 Ok(())
13766 }
13767
13768 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.memberChange"))]
13769 async fn handle_memberChange<'a>(
13770 &'a self,
13771 p: &'a mut P::Deserializer,
13772 req_ctxt: &R,
13773 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13774 _seqid: ::std::primitive::u32,
13775 ) -> ::anyhow::Result<()> {
13776 use ::const_cstr::const_cstr;
13777 use ::futures::FutureExt as _;
13778
13779 const_cstr! {
13780 SERVICE_NAME = "StorageAdminService";
13781 METHOD_NAME = "StorageAdminService.memberChange";
13782 }
13783 let mut ctx_stack = req_ctxt.get_context_stack(
13784 SERVICE_NAME.as_cstr(),
13785 METHOD_NAME.as_cstr(),
13786 )?;
13787 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13788 let _args: self::Args_StorageAdminService_memberChange = ::fbthrift::Deserialize::read(p)?;
13789 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13790 protocol: P::PROTOCOL_ID,
13791 method_name: METHOD_NAME.as_cstr(),
13792 buffer: ::std::marker::PhantomData, })?;
13794 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13795
13796 let res = ::std::panic::AssertUnwindSafe(
13797 self.service.memberChange(
13798 _args.req,
13799 )
13800 )
13801 .catch_unwind()
13802 .await;
13803
13804 let res = match res {
13806 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13807 ::tracing::info!("success");
13808 crate::services::storage_admin_service::MemberChangeExn::Success(res)
13809 }
13810 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::MemberChangeExn::Success(_))) => {
13811 panic!(
13812 "{} attempted to return success via error",
13813 "memberChange",
13814 )
13815 }
13816 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13817 ::tracing::error!(exception = ?exn);
13818 exn
13819 }
13820 ::std::result::Result::Err(exn) => {
13821 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.memberChange", exn);
13822 crate::services::storage_admin_service::MemberChangeExn::ApplicationException(aexn)
13823 }
13824 };
13825
13826 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13827 "memberChange",
13828 METHOD_NAME.as_cstr(),
13829 _seqid,
13830 req_ctxt,
13831 &mut ctx_stack,
13832 res
13833 )?;
13834 reply_state.lock().unwrap().send_reply(env);
13835 Ok(())
13836 }
13837
13838 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.waitingForCatchUpData"))]
13839 async fn handle_waitingForCatchUpData<'a>(
13840 &'a self,
13841 p: &'a mut P::Deserializer,
13842 req_ctxt: &R,
13843 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13844 _seqid: ::std::primitive::u32,
13845 ) -> ::anyhow::Result<()> {
13846 use ::const_cstr::const_cstr;
13847 use ::futures::FutureExt as _;
13848
13849 const_cstr! {
13850 SERVICE_NAME = "StorageAdminService";
13851 METHOD_NAME = "StorageAdminService.waitingForCatchUpData";
13852 }
13853 let mut ctx_stack = req_ctxt.get_context_stack(
13854 SERVICE_NAME.as_cstr(),
13855 METHOD_NAME.as_cstr(),
13856 )?;
13857 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13858 let _args: self::Args_StorageAdminService_waitingForCatchUpData = ::fbthrift::Deserialize::read(p)?;
13859 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13860 protocol: P::PROTOCOL_ID,
13861 method_name: METHOD_NAME.as_cstr(),
13862 buffer: ::std::marker::PhantomData, })?;
13864 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13865
13866 let res = ::std::panic::AssertUnwindSafe(
13867 self.service.waitingForCatchUpData(
13868 _args.req,
13869 )
13870 )
13871 .catch_unwind()
13872 .await;
13873
13874 let res = match res {
13876 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13877 ::tracing::info!("success");
13878 crate::services::storage_admin_service::WaitingForCatchUpDataExn::Success(res)
13879 }
13880 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::WaitingForCatchUpDataExn::Success(_))) => {
13881 panic!(
13882 "{} attempted to return success via error",
13883 "waitingForCatchUpData",
13884 )
13885 }
13886 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13887 ::tracing::error!(exception = ?exn);
13888 exn
13889 }
13890 ::std::result::Result::Err(exn) => {
13891 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.waitingForCatchUpData", exn);
13892 crate::services::storage_admin_service::WaitingForCatchUpDataExn::ApplicationException(aexn)
13893 }
13894 };
13895
13896 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13897 "waitingForCatchUpData",
13898 METHOD_NAME.as_cstr(),
13899 _seqid,
13900 req_ctxt,
13901 &mut ctx_stack,
13902 res
13903 )?;
13904 reply_state.lock().unwrap().send_reply(env);
13905 Ok(())
13906 }
13907
13908 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.createCheckpoint"))]
13909 async fn handle_createCheckpoint<'a>(
13910 &'a self,
13911 p: &'a mut P::Deserializer,
13912 req_ctxt: &R,
13913 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13914 _seqid: ::std::primitive::u32,
13915 ) -> ::anyhow::Result<()> {
13916 use ::const_cstr::const_cstr;
13917 use ::futures::FutureExt as _;
13918
13919 const_cstr! {
13920 SERVICE_NAME = "StorageAdminService";
13921 METHOD_NAME = "StorageAdminService.createCheckpoint";
13922 }
13923 let mut ctx_stack = req_ctxt.get_context_stack(
13924 SERVICE_NAME.as_cstr(),
13925 METHOD_NAME.as_cstr(),
13926 )?;
13927 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13928 let _args: self::Args_StorageAdminService_createCheckpoint = ::fbthrift::Deserialize::read(p)?;
13929 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
13930 protocol: P::PROTOCOL_ID,
13931 method_name: METHOD_NAME.as_cstr(),
13932 buffer: ::std::marker::PhantomData, })?;
13934 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
13935
13936 let res = ::std::panic::AssertUnwindSafe(
13937 self.service.createCheckpoint(
13938 _args.req,
13939 )
13940 )
13941 .catch_unwind()
13942 .await;
13943
13944 let res = match res {
13946 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
13947 ::tracing::info!("success");
13948 crate::services::storage_admin_service::CreateCheckpointExn::Success(res)
13949 }
13950 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::CreateCheckpointExn::Success(_))) => {
13951 panic!(
13952 "{} attempted to return success via error",
13953 "createCheckpoint",
13954 )
13955 }
13956 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
13957 ::tracing::error!(exception = ?exn);
13958 exn
13959 }
13960 ::std::result::Result::Err(exn) => {
13961 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.createCheckpoint", exn);
13962 crate::services::storage_admin_service::CreateCheckpointExn::ApplicationException(aexn)
13963 }
13964 };
13965
13966 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
13967 "createCheckpoint",
13968 METHOD_NAME.as_cstr(),
13969 _seqid,
13970 req_ctxt,
13971 &mut ctx_stack,
13972 res
13973 )?;
13974 reply_state.lock().unwrap().send_reply(env);
13975 Ok(())
13976 }
13977
13978 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.dropCheckpoint"))]
13979 async fn handle_dropCheckpoint<'a>(
13980 &'a self,
13981 p: &'a mut P::Deserializer,
13982 req_ctxt: &R,
13983 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
13984 _seqid: ::std::primitive::u32,
13985 ) -> ::anyhow::Result<()> {
13986 use ::const_cstr::const_cstr;
13987 use ::futures::FutureExt as _;
13988
13989 const_cstr! {
13990 SERVICE_NAME = "StorageAdminService";
13991 METHOD_NAME = "StorageAdminService.dropCheckpoint";
13992 }
13993 let mut ctx_stack = req_ctxt.get_context_stack(
13994 SERVICE_NAME.as_cstr(),
13995 METHOD_NAME.as_cstr(),
13996 )?;
13997 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
13998 let _args: self::Args_StorageAdminService_dropCheckpoint = ::fbthrift::Deserialize::read(p)?;
13999 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14000 protocol: P::PROTOCOL_ID,
14001 method_name: METHOD_NAME.as_cstr(),
14002 buffer: ::std::marker::PhantomData, })?;
14004 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14005
14006 let res = ::std::panic::AssertUnwindSafe(
14007 self.service.dropCheckpoint(
14008 _args.req,
14009 )
14010 )
14011 .catch_unwind()
14012 .await;
14013
14014 let res = match res {
14016 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14017 ::tracing::info!("success");
14018 crate::services::storage_admin_service::DropCheckpointExn::Success(res)
14019 }
14020 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::DropCheckpointExn::Success(_))) => {
14021 panic!(
14022 "{} attempted to return success via error",
14023 "dropCheckpoint",
14024 )
14025 }
14026 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14027 ::tracing::error!(exception = ?exn);
14028 exn
14029 }
14030 ::std::result::Result::Err(exn) => {
14031 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.dropCheckpoint", exn);
14032 crate::services::storage_admin_service::DropCheckpointExn::ApplicationException(aexn)
14033 }
14034 };
14035
14036 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14037 "dropCheckpoint",
14038 METHOD_NAME.as_cstr(),
14039 _seqid,
14040 req_ctxt,
14041 &mut ctx_stack,
14042 res
14043 )?;
14044 reply_state.lock().unwrap().send_reply(env);
14045 Ok(())
14046 }
14047
14048 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.blockingWrites"))]
14049 async fn handle_blockingWrites<'a>(
14050 &'a self,
14051 p: &'a mut P::Deserializer,
14052 req_ctxt: &R,
14053 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14054 _seqid: ::std::primitive::u32,
14055 ) -> ::anyhow::Result<()> {
14056 use ::const_cstr::const_cstr;
14057 use ::futures::FutureExt as _;
14058
14059 const_cstr! {
14060 SERVICE_NAME = "StorageAdminService";
14061 METHOD_NAME = "StorageAdminService.blockingWrites";
14062 }
14063 let mut ctx_stack = req_ctxt.get_context_stack(
14064 SERVICE_NAME.as_cstr(),
14065 METHOD_NAME.as_cstr(),
14066 )?;
14067 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14068 let _args: self::Args_StorageAdminService_blockingWrites = ::fbthrift::Deserialize::read(p)?;
14069 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14070 protocol: P::PROTOCOL_ID,
14071 method_name: METHOD_NAME.as_cstr(),
14072 buffer: ::std::marker::PhantomData, })?;
14074 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14075
14076 let res = ::std::panic::AssertUnwindSafe(
14077 self.service.blockingWrites(
14078 _args.req,
14079 )
14080 )
14081 .catch_unwind()
14082 .await;
14083
14084 let res = match res {
14086 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14087 ::tracing::info!("success");
14088 crate::services::storage_admin_service::BlockingWritesExn::Success(res)
14089 }
14090 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::BlockingWritesExn::Success(_))) => {
14091 panic!(
14092 "{} attempted to return success via error",
14093 "blockingWrites",
14094 )
14095 }
14096 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14097 ::tracing::error!(exception = ?exn);
14098 exn
14099 }
14100 ::std::result::Result::Err(exn) => {
14101 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.blockingWrites", exn);
14102 crate::services::storage_admin_service::BlockingWritesExn::ApplicationException(aexn)
14103 }
14104 };
14105
14106 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14107 "blockingWrites",
14108 METHOD_NAME.as_cstr(),
14109 _seqid,
14110 req_ctxt,
14111 &mut ctx_stack,
14112 res
14113 )?;
14114 reply_state.lock().unwrap().send_reply(env);
14115 Ok(())
14116 }
14117
14118 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.getLeaderParts"))]
14119 async fn handle_getLeaderParts<'a>(
14120 &'a self,
14121 p: &'a mut P::Deserializer,
14122 req_ctxt: &R,
14123 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14124 _seqid: ::std::primitive::u32,
14125 ) -> ::anyhow::Result<()> {
14126 use ::const_cstr::const_cstr;
14127 use ::futures::FutureExt as _;
14128
14129 const_cstr! {
14130 SERVICE_NAME = "StorageAdminService";
14131 METHOD_NAME = "StorageAdminService.getLeaderParts";
14132 }
14133 let mut ctx_stack = req_ctxt.get_context_stack(
14134 SERVICE_NAME.as_cstr(),
14135 METHOD_NAME.as_cstr(),
14136 )?;
14137 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14138 let _args: self::Args_StorageAdminService_getLeaderParts = ::fbthrift::Deserialize::read(p)?;
14139 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14140 protocol: P::PROTOCOL_ID,
14141 method_name: METHOD_NAME.as_cstr(),
14142 buffer: ::std::marker::PhantomData, })?;
14144 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14145
14146 let res = ::std::panic::AssertUnwindSafe(
14147 self.service.getLeaderParts(
14148 _args.req,
14149 )
14150 )
14151 .catch_unwind()
14152 .await;
14153
14154 let res = match res {
14156 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14157 ::tracing::info!("success");
14158 crate::services::storage_admin_service::GetLeaderPartsExn::Success(res)
14159 }
14160 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::GetLeaderPartsExn::Success(_))) => {
14161 panic!(
14162 "{} attempted to return success via error",
14163 "getLeaderParts",
14164 )
14165 }
14166 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14167 ::tracing::error!(exception = ?exn);
14168 exn
14169 }
14170 ::std::result::Result::Err(exn) => {
14171 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.getLeaderParts", exn);
14172 crate::services::storage_admin_service::GetLeaderPartsExn::ApplicationException(aexn)
14173 }
14174 };
14175
14176 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14177 "getLeaderParts",
14178 METHOD_NAME.as_cstr(),
14179 _seqid,
14180 req_ctxt,
14181 &mut ctx_stack,
14182 res
14183 )?;
14184 reply_state.lock().unwrap().send_reply(env);
14185 Ok(())
14186 }
14187
14188 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.checkPeers"))]
14189 async fn handle_checkPeers<'a>(
14190 &'a self,
14191 p: &'a mut P::Deserializer,
14192 req_ctxt: &R,
14193 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14194 _seqid: ::std::primitive::u32,
14195 ) -> ::anyhow::Result<()> {
14196 use ::const_cstr::const_cstr;
14197 use ::futures::FutureExt as _;
14198
14199 const_cstr! {
14200 SERVICE_NAME = "StorageAdminService";
14201 METHOD_NAME = "StorageAdminService.checkPeers";
14202 }
14203 let mut ctx_stack = req_ctxt.get_context_stack(
14204 SERVICE_NAME.as_cstr(),
14205 METHOD_NAME.as_cstr(),
14206 )?;
14207 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14208 let _args: self::Args_StorageAdminService_checkPeers = ::fbthrift::Deserialize::read(p)?;
14209 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14210 protocol: P::PROTOCOL_ID,
14211 method_name: METHOD_NAME.as_cstr(),
14212 buffer: ::std::marker::PhantomData, })?;
14214 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14215
14216 let res = ::std::panic::AssertUnwindSafe(
14217 self.service.checkPeers(
14218 _args.req,
14219 )
14220 )
14221 .catch_unwind()
14222 .await;
14223
14224 let res = match res {
14226 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14227 ::tracing::info!("success");
14228 crate::services::storage_admin_service::CheckPeersExn::Success(res)
14229 }
14230 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::CheckPeersExn::Success(_))) => {
14231 panic!(
14232 "{} attempted to return success via error",
14233 "checkPeers",
14234 )
14235 }
14236 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14237 ::tracing::error!(exception = ?exn);
14238 exn
14239 }
14240 ::std::result::Result::Err(exn) => {
14241 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.checkPeers", exn);
14242 crate::services::storage_admin_service::CheckPeersExn::ApplicationException(aexn)
14243 }
14244 };
14245
14246 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14247 "checkPeers",
14248 METHOD_NAME.as_cstr(),
14249 _seqid,
14250 req_ctxt,
14251 &mut ctx_stack,
14252 res
14253 )?;
14254 reply_state.lock().unwrap().send_reply(env);
14255 Ok(())
14256 }
14257
14258 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.addAdminTask"))]
14259 async fn handle_addAdminTask<'a>(
14260 &'a self,
14261 p: &'a mut P::Deserializer,
14262 req_ctxt: &R,
14263 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14264 _seqid: ::std::primitive::u32,
14265 ) -> ::anyhow::Result<()> {
14266 use ::const_cstr::const_cstr;
14267 use ::futures::FutureExt as _;
14268
14269 const_cstr! {
14270 SERVICE_NAME = "StorageAdminService";
14271 METHOD_NAME = "StorageAdminService.addAdminTask";
14272 }
14273 let mut ctx_stack = req_ctxt.get_context_stack(
14274 SERVICE_NAME.as_cstr(),
14275 METHOD_NAME.as_cstr(),
14276 )?;
14277 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14278 let _args: self::Args_StorageAdminService_addAdminTask = ::fbthrift::Deserialize::read(p)?;
14279 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14280 protocol: P::PROTOCOL_ID,
14281 method_name: METHOD_NAME.as_cstr(),
14282 buffer: ::std::marker::PhantomData, })?;
14284 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14285
14286 let res = ::std::panic::AssertUnwindSafe(
14287 self.service.addAdminTask(
14288 _args.req,
14289 )
14290 )
14291 .catch_unwind()
14292 .await;
14293
14294 let res = match res {
14296 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14297 ::tracing::info!("success");
14298 crate::services::storage_admin_service::AddAdminTaskExn::Success(res)
14299 }
14300 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::AddAdminTaskExn::Success(_))) => {
14301 panic!(
14302 "{} attempted to return success via error",
14303 "addAdminTask",
14304 )
14305 }
14306 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14307 ::tracing::error!(exception = ?exn);
14308 exn
14309 }
14310 ::std::result::Result::Err(exn) => {
14311 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.addAdminTask", exn);
14312 crate::services::storage_admin_service::AddAdminTaskExn::ApplicationException(aexn)
14313 }
14314 };
14315
14316 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14317 "addAdminTask",
14318 METHOD_NAME.as_cstr(),
14319 _seqid,
14320 req_ctxt,
14321 &mut ctx_stack,
14322 res
14323 )?;
14324 reply_state.lock().unwrap().send_reply(env);
14325 Ok(())
14326 }
14327
14328 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.stopAdminTask"))]
14329 async fn handle_stopAdminTask<'a>(
14330 &'a self,
14331 p: &'a mut P::Deserializer,
14332 req_ctxt: &R,
14333 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14334 _seqid: ::std::primitive::u32,
14335 ) -> ::anyhow::Result<()> {
14336 use ::const_cstr::const_cstr;
14337 use ::futures::FutureExt as _;
14338
14339 const_cstr! {
14340 SERVICE_NAME = "StorageAdminService";
14341 METHOD_NAME = "StorageAdminService.stopAdminTask";
14342 }
14343 let mut ctx_stack = req_ctxt.get_context_stack(
14344 SERVICE_NAME.as_cstr(),
14345 METHOD_NAME.as_cstr(),
14346 )?;
14347 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14348 let _args: self::Args_StorageAdminService_stopAdminTask = ::fbthrift::Deserialize::read(p)?;
14349 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14350 protocol: P::PROTOCOL_ID,
14351 method_name: METHOD_NAME.as_cstr(),
14352 buffer: ::std::marker::PhantomData, })?;
14354 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14355
14356 let res = ::std::panic::AssertUnwindSafe(
14357 self.service.stopAdminTask(
14358 _args.req,
14359 )
14360 )
14361 .catch_unwind()
14362 .await;
14363
14364 let res = match res {
14366 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14367 ::tracing::info!("success");
14368 crate::services::storage_admin_service::StopAdminTaskExn::Success(res)
14369 }
14370 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::StopAdminTaskExn::Success(_))) => {
14371 panic!(
14372 "{} attempted to return success via error",
14373 "stopAdminTask",
14374 )
14375 }
14376 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14377 ::tracing::error!(exception = ?exn);
14378 exn
14379 }
14380 ::std::result::Result::Err(exn) => {
14381 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.stopAdminTask", exn);
14382 crate::services::storage_admin_service::StopAdminTaskExn::ApplicationException(aexn)
14383 }
14384 };
14385
14386 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14387 "stopAdminTask",
14388 METHOD_NAME.as_cstr(),
14389 _seqid,
14390 req_ctxt,
14391 &mut ctx_stack,
14392 res
14393 )?;
14394 reply_state.lock().unwrap().send_reply(env);
14395 Ok(())
14396 }
14397
14398 #[::tracing::instrument(skip_all, name = "handler", fields(method = "StorageAdminService.clearSpace"))]
14399 async fn handle_clearSpace<'a>(
14400 &'a self,
14401 p: &'a mut P::Deserializer,
14402 req_ctxt: &R,
14403 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14404 _seqid: ::std::primitive::u32,
14405 ) -> ::anyhow::Result<()> {
14406 use ::const_cstr::const_cstr;
14407 use ::futures::FutureExt as _;
14408
14409 const_cstr! {
14410 SERVICE_NAME = "StorageAdminService";
14411 METHOD_NAME = "StorageAdminService.clearSpace";
14412 }
14413 let mut ctx_stack = req_ctxt.get_context_stack(
14414 SERVICE_NAME.as_cstr(),
14415 METHOD_NAME.as_cstr(),
14416 )?;
14417 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14418 let _args: self::Args_StorageAdminService_clearSpace = ::fbthrift::Deserialize::read(p)?;
14419 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14420 protocol: P::PROTOCOL_ID,
14421 method_name: METHOD_NAME.as_cstr(),
14422 buffer: ::std::marker::PhantomData, })?;
14424 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14425
14426 let res = ::std::panic::AssertUnwindSafe(
14427 self.service.clearSpace(
14428 _args.req,
14429 )
14430 )
14431 .catch_unwind()
14432 .await;
14433
14434 let res = match res {
14436 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14437 ::tracing::info!("success");
14438 crate::services::storage_admin_service::ClearSpaceExn::Success(res)
14439 }
14440 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::storage_admin_service::ClearSpaceExn::Success(_))) => {
14441 panic!(
14442 "{} attempted to return success via error",
14443 "clearSpace",
14444 )
14445 }
14446 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14447 ::tracing::error!(exception = ?exn);
14448 exn
14449 }
14450 ::std::result::Result::Err(exn) => {
14451 let aexn = ::fbthrift::ApplicationException::handler_panic("StorageAdminService.clearSpace", exn);
14452 crate::services::storage_admin_service::ClearSpaceExn::ApplicationException(aexn)
14453 }
14454 };
14455
14456 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14457 "clearSpace",
14458 METHOD_NAME.as_cstr(),
14459 _seqid,
14460 req_ctxt,
14461 &mut ctx_stack,
14462 res
14463 )?;
14464 reply_state.lock().unwrap().send_reply(env);
14465 Ok(())
14466 }
14467 }
14468
14469 #[::async_trait::async_trait]
14470 impl<P, H, R, RS> ::fbthrift::ServiceProcessor<P> for StorageAdminServiceProcessor<P, H, R, RS>
14471 where
14472 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
14473 P::Deserializer: ::std::marker::Send,
14474 H: StorageAdminService,
14475 P::Frame: ::std::marker::Send + 'static,
14476 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
14477 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
14478 + ::std::marker::Send + ::std::marker::Sync + 'static,
14479 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
14480 {
14481 type RequestContext = R;
14482 type ReplyState = RS;
14483
14484 #[inline]
14485 fn method_idx(&self, name: &[::std::primitive::u8]) -> ::std::result::Result<::std::primitive::usize, ::fbthrift::ApplicationException> {
14486 match name {
14487 b"transLeader" => ::std::result::Result::Ok(0usize),
14488 b"addPart" => ::std::result::Result::Ok(1usize),
14489 b"addLearner" => ::std::result::Result::Ok(2usize),
14490 b"removePart" => ::std::result::Result::Ok(3usize),
14491 b"memberChange" => ::std::result::Result::Ok(4usize),
14492 b"waitingForCatchUpData" => ::std::result::Result::Ok(5usize),
14493 b"createCheckpoint" => ::std::result::Result::Ok(6usize),
14494 b"dropCheckpoint" => ::std::result::Result::Ok(7usize),
14495 b"blockingWrites" => ::std::result::Result::Ok(8usize),
14496 b"getLeaderParts" => ::std::result::Result::Ok(9usize),
14497 b"checkPeers" => ::std::result::Result::Ok(10usize),
14498 b"addAdminTask" => ::std::result::Result::Ok(11usize),
14499 b"stopAdminTask" => ::std::result::Result::Ok(12usize),
14500 b"clearSpace" => ::std::result::Result::Ok(13usize),
14501 _ => ::std::result::Result::Err(::fbthrift::ApplicationException::unknown_method()),
14502 }
14503 }
14504
14505 #[allow(clippy::match_single_binding)]
14506 async fn handle_method(
14507 &self,
14508 idx: ::std::primitive::usize,
14509 _p: &mut P::Deserializer,
14510 _r: &R,
14511 _reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14512 _seqid: ::std::primitive::u32,
14513 ) -> ::anyhow::Result<()> {
14514 match idx {
14515 0usize => {
14516 self.handle_transLeader(_p, _r, _reply_state, _seqid).await
14517 }
14518 1usize => {
14519 self.handle_addPart(_p, _r, _reply_state, _seqid).await
14520 }
14521 2usize => {
14522 self.handle_addLearner(_p, _r, _reply_state, _seqid).await
14523 }
14524 3usize => {
14525 self.handle_removePart(_p, _r, _reply_state, _seqid).await
14526 }
14527 4usize => {
14528 self.handle_memberChange(_p, _r, _reply_state, _seqid).await
14529 }
14530 5usize => {
14531 self.handle_waitingForCatchUpData(_p, _r, _reply_state, _seqid).await
14532 }
14533 6usize => {
14534 self.handle_createCheckpoint(_p, _r, _reply_state, _seqid).await
14535 }
14536 7usize => {
14537 self.handle_dropCheckpoint(_p, _r, _reply_state, _seqid).await
14538 }
14539 8usize => {
14540 self.handle_blockingWrites(_p, _r, _reply_state, _seqid).await
14541 }
14542 9usize => {
14543 self.handle_getLeaderParts(_p, _r, _reply_state, _seqid).await
14544 }
14545 10usize => {
14546 self.handle_checkPeers(_p, _r, _reply_state, _seqid).await
14547 }
14548 11usize => {
14549 self.handle_addAdminTask(_p, _r, _reply_state, _seqid).await
14550 }
14551 12usize => {
14552 self.handle_stopAdminTask(_p, _r, _reply_state, _seqid).await
14553 }
14554 13usize => {
14555 self.handle_clearSpace(_p, _r, _reply_state, _seqid).await
14556 }
14557 bad => panic!(
14558 "{}: unexpected method idx {}",
14559 "StorageAdminServiceProcessor",
14560 bad
14561 ),
14562 }
14563 }
14564
14565 #[allow(clippy::match_single_binding)]
14566 #[inline]
14567 fn create_interaction_idx(&self, name: &str) -> ::anyhow::Result<::std::primitive::usize> {
14568 match name {
14569 _ => ::anyhow::bail!("Unknown interaction"),
14570 }
14571 }
14572
14573 #[allow(clippy::match_single_binding)]
14574 fn handle_create_interaction(
14575 &self,
14576 idx: ::std::primitive::usize,
14577 ) -> ::anyhow::Result<
14578 ::std::sync::Arc<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = Self::RequestContext, ReplyState = Self::ReplyState> + ::std::marker::Send + 'static>
14579 > {
14580 match idx {
14581 bad => panic!(
14582 "{}: unexpected method idx {}",
14583 "StorageAdminServiceProcessor",
14584 bad
14585 ),
14586 }
14587 }
14588 }
14589
14590 #[::async_trait::async_trait]
14591 impl<P, H, R, RS> ::fbthrift::ThriftService<P::Frame> for StorageAdminServiceProcessor<P, H, R, RS>
14592 where
14593 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
14594 P::Deserializer: ::std::marker::Send,
14595 P::Frame: ::std::marker::Send + 'static,
14596 H: StorageAdminService,
14597 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
14598 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
14599 + ::std::marker::Send + ::std::marker::Sync + 'static,
14600 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
14601 {
14602 type Handler = H;
14603 type RequestContext = R;
14604 type ReplyState = RS;
14605
14606 #[tracing::instrument(level="trace", skip_all, fields(service = "StorageAdminService"))]
14607 async fn call(
14608 &self,
14609 req: ::fbthrift::ProtocolDecoded<P>,
14610 req_ctxt: &R,
14611 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14612 ) -> ::anyhow::Result<()> {
14613 use ::fbthrift::{BufExt as _, ProtocolReader as _, ServiceProcessor as _};
14614 let mut p = P::deserializer(req);
14615 let (idx, mty, seqid) = p.read_message_begin(|name| self.method_idx(name))?;
14616 if mty != ::fbthrift::MessageType::Call {
14617 return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
14618 ::fbthrift::ApplicationExceptionErrorCode::InvalidMessageType,
14619 format!("message type {:?} not handled", mty)
14620 )));
14621 }
14622 let idx = match idx {
14623 ::std::result::Result::Ok(idx) => idx,
14624 ::std::result::Result::Err(_) => {
14625 let cur = P::into_buffer(p).reset();
14626 return self.supa.call(cur, req_ctxt, reply_state).await;
14627 }
14628 };
14629 self.handle_method(idx, &mut p, req_ctxt, reply_state, seqid).await?;
14630 p.read_message_end()?;
14631
14632 Ok(())
14633 }
14634
14635 fn create_interaction(
14636 &self,
14637 name: &str,
14638 ) -> ::anyhow::Result<
14639 ::std::sync::Arc<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>
14640 > {
14641 use ::fbthrift::{ServiceProcessor as _};
14642 let idx = self.create_interaction_idx(name);
14643 let idx = match idx {
14644 ::anyhow::Result::Ok(idx) => idx,
14645 ::anyhow::Result::Err(_) => {
14646 return self.supa.create_interaction(name);
14647 }
14648 };
14649 self.handle_create_interaction(idx)
14650 }
14651
14652 fn get_method_names(&self) -> &'static [&'static str] {
14653 &[
14654 "transLeader",
14656 "addPart",
14657 "addLearner",
14658 "removePart",
14659 "memberChange",
14660 "waitingForCatchUpData",
14661 "createCheckpoint",
14662 "dropCheckpoint",
14663 "blockingWrites",
14664 "getLeaderParts",
14665 "checkPeers",
14666 "addAdminTask",
14667 "stopAdminTask",
14668 "clearSpace",
14669 ]
14670 }
14671 }
14672
14673 #[::tracing::instrument(level="debug", skip_all, fields(proto = ?proto))]
14678 pub fn make_StorageAdminService_server<F, H, R, RS>(
14679 proto: ::fbthrift::ProtocolID,
14680 handler: H,
14681 ) -> ::std::result::Result<::std::boxed::Box<dyn ::fbthrift::ThriftService<F, Handler = H, RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>, ::fbthrift::ApplicationException>
14682 where
14683 F: ::fbthrift::Framing + ::std::marker::Send + ::std::marker::Sync + 'static,
14684 H: StorageAdminService,
14685 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
14686 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = F::DecBuf> + ::std::marker::Send + ::std::marker::Sync + 'static,
14687 RS: ::fbthrift::ReplyState<F, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
14688 {
14689 match proto {
14690 ::fbthrift::ProtocolID::BinaryProtocol => {
14691 ::std::result::Result::Ok(::std::boxed::Box::new(StorageAdminServiceProcessor::<::fbthrift::BinaryProtocol<F>, H, R, RS>::new(handler)))
14692 }
14693 ::fbthrift::ProtocolID::CompactProtocol => {
14694 ::std::result::Result::Ok(::std::boxed::Box::new(StorageAdminServiceProcessor::<::fbthrift::CompactProtocol<F>, H, R, RS>::new(handler)))
14695 }
14696 bad => {
14697 ::tracing::error!(method = "StorageAdminService.", invalid_protocol = ?bad);
14698 ::std::result::Result::Err(::fbthrift::ApplicationException::invalid_protocol(bad))
14699 }
14700 }
14701 }
14702
14703 #[::async_trait::async_trait]
14704 pub trait InternalStorageService: ::std::marker::Send + ::std::marker::Sync + 'static {
14705 async fn chainAddEdges(
14706 &self,
14707 _req: crate::types::ChainAddEdgesRequest,
14708 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::internal_storage_service::ChainAddEdgesExn> {
14709 ::std::result::Result::Err(crate::services::internal_storage_service::ChainAddEdgesExn::ApplicationException(
14710 ::fbthrift::ApplicationException::unimplemented_method(
14711 "InternalStorageService",
14712 "chainAddEdges",
14713 ),
14714 ))
14715 }
14716 async fn chainUpdateEdge(
14717 &self,
14718 _req: crate::types::ChainUpdateEdgeRequest,
14719 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::internal_storage_service::ChainUpdateEdgeExn> {
14720 ::std::result::Result::Err(crate::services::internal_storage_service::ChainUpdateEdgeExn::ApplicationException(
14721 ::fbthrift::ApplicationException::unimplemented_method(
14722 "InternalStorageService",
14723 "chainUpdateEdge",
14724 ),
14725 ))
14726 }
14727 async fn chainDeleteEdges(
14728 &self,
14729 _req: crate::types::ChainDeleteEdgesRequest,
14730 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::internal_storage_service::ChainDeleteEdgesExn> {
14731 ::std::result::Result::Err(crate::services::internal_storage_service::ChainDeleteEdgesExn::ApplicationException(
14732 ::fbthrift::ApplicationException::unimplemented_method(
14733 "InternalStorageService",
14734 "chainDeleteEdges",
14735 ),
14736 ))
14737 }
14738 }
14739
14740 #[::async_trait::async_trait]
14741 impl<T> InternalStorageService for ::std::boxed::Box<T>
14742 where
14743 T: InternalStorageService + Send + Sync + ?Sized,
14744 {
14745 async fn chainAddEdges(
14746 &self,
14747 req: crate::types::ChainAddEdgesRequest,
14748 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::internal_storage_service::ChainAddEdgesExn> {
14749 (**self).chainAddEdges(
14750 req,
14751 ).await
14752 }
14753 async fn chainUpdateEdge(
14754 &self,
14755 req: crate::types::ChainUpdateEdgeRequest,
14756 ) -> ::std::result::Result<crate::types::UpdateResponse, crate::services::internal_storage_service::ChainUpdateEdgeExn> {
14757 (**self).chainUpdateEdge(
14758 req,
14759 ).await
14760 }
14761 async fn chainDeleteEdges(
14762 &self,
14763 req: crate::types::ChainDeleteEdgesRequest,
14764 ) -> ::std::result::Result<crate::types::ExecResponse, crate::services::internal_storage_service::ChainDeleteEdgesExn> {
14765 (**self).chainDeleteEdges(
14766 req,
14767 ).await
14768 }
14769 }
14770
14771 #[derive(Clone, Debug)]
14773 pub struct InternalStorageServiceProcessor<P, H, R, RS> {
14774 service: H,
14775 supa: ::fbthrift::NullServiceProcessor<P, R, RS>,
14776 _phantom: ::std::marker::PhantomData<(P, H, R, RS)>,
14777 }
14778
14779 struct Args_InternalStorageService_chainAddEdges {
14780 req: crate::types::ChainAddEdgesRequest,
14781 }
14782 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_InternalStorageService_chainAddEdges {
14783 #[inline]
14784 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "InternalStorageService.chainAddEdges"))]
14785 fn read(p: &mut P) -> ::anyhow::Result<Self> {
14786 static ARGS: &[::fbthrift::Field] = &[
14787 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
14788 ];
14789 let mut field_req = ::std::option::Option::None;
14790 let _ = p.read_struct_begin(|_| ())?;
14791 loop {
14792 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
14793 match (fty, fid as ::std::primitive::i32) {
14794 (::fbthrift::TType::Stop, _) => break,
14795 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
14796 (fty, _) => p.skip(fty)?,
14797 }
14798 p.read_field_end()?;
14799 }
14800 p.read_struct_end()?;
14801 ::std::result::Result::Ok(Self {
14802 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "InternalStorageService.chainAddEdges", "req"))?,
14803 })
14804 }
14805 }
14806
14807 struct Args_InternalStorageService_chainUpdateEdge {
14808 req: crate::types::ChainUpdateEdgeRequest,
14809 }
14810 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_InternalStorageService_chainUpdateEdge {
14811 #[inline]
14812 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "InternalStorageService.chainUpdateEdge"))]
14813 fn read(p: &mut P) -> ::anyhow::Result<Self> {
14814 static ARGS: &[::fbthrift::Field] = &[
14815 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
14816 ];
14817 let mut field_req = ::std::option::Option::None;
14818 let _ = p.read_struct_begin(|_| ())?;
14819 loop {
14820 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
14821 match (fty, fid as ::std::primitive::i32) {
14822 (::fbthrift::TType::Stop, _) => break,
14823 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
14824 (fty, _) => p.skip(fty)?,
14825 }
14826 p.read_field_end()?;
14827 }
14828 p.read_struct_end()?;
14829 ::std::result::Result::Ok(Self {
14830 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "InternalStorageService.chainUpdateEdge", "req"))?,
14831 })
14832 }
14833 }
14834
14835 struct Args_InternalStorageService_chainDeleteEdges {
14836 req: crate::types::ChainDeleteEdgesRequest,
14837 }
14838 impl<P: ::fbthrift::ProtocolReader> ::fbthrift::Deserialize<P> for self::Args_InternalStorageService_chainDeleteEdges {
14839 #[inline]
14840 #[::tracing::instrument(skip_all, level = "trace", name = "deserialize_args", fields(method = "InternalStorageService.chainDeleteEdges"))]
14841 fn read(p: &mut P) -> ::anyhow::Result<Self> {
14842 static ARGS: &[::fbthrift::Field] = &[
14843 ::fbthrift::Field::new("req", ::fbthrift::TType::Struct, 1),
14844 ];
14845 let mut field_req = ::std::option::Option::None;
14846 let _ = p.read_struct_begin(|_| ())?;
14847 loop {
14848 let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
14849 match (fty, fid as ::std::primitive::i32) {
14850 (::fbthrift::TType::Stop, _) => break,
14851 (::fbthrift::TType::Struct, 1) => field_req = ::std::option::Option::Some(::fbthrift::Deserialize::read(p)?),
14852 (fty, _) => p.skip(fty)?,
14853 }
14854 p.read_field_end()?;
14855 }
14856 p.read_struct_end()?;
14857 ::std::result::Result::Ok(Self {
14858 req: field_req.ok_or_else(|| ::anyhow::anyhow!("`{}` missing arg `{}`", "InternalStorageService.chainDeleteEdges", "req"))?,
14859 })
14860 }
14861 }
14862
14863
14864 impl<P, H, R, RS> InternalStorageServiceProcessor<P, H, R, RS>
14865 where
14866 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
14867 P::Frame: ::std::marker::Send + 'static,
14868 P::Deserializer: ::std::marker::Send,
14869 H: InternalStorageService,
14870 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
14871 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static,
14872 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
14873 + ::std::marker::Send + ::std::marker::Sync,
14874 {
14875 pub fn new(service: H) -> Self {
14876 Self {
14877 service,
14878 supa: ::fbthrift::NullServiceProcessor::new(),
14879 _phantom: ::std::marker::PhantomData,
14880 }
14881 }
14882
14883 pub fn into_inner(self) -> H {
14884 self.service
14885 }
14886
14887 #[::tracing::instrument(skip_all, name = "handler", fields(method = "InternalStorageService.chainAddEdges"))]
14888 async fn handle_chainAddEdges<'a>(
14889 &'a self,
14890 p: &'a mut P::Deserializer,
14891 req_ctxt: &R,
14892 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14893 _seqid: ::std::primitive::u32,
14894 ) -> ::anyhow::Result<()> {
14895 use ::const_cstr::const_cstr;
14896 use ::futures::FutureExt as _;
14897
14898 const_cstr! {
14899 SERVICE_NAME = "InternalStorageService";
14900 METHOD_NAME = "InternalStorageService.chainAddEdges";
14901 }
14902 let mut ctx_stack = req_ctxt.get_context_stack(
14903 SERVICE_NAME.as_cstr(),
14904 METHOD_NAME.as_cstr(),
14905 )?;
14906 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14907 let _args: self::Args_InternalStorageService_chainAddEdges = ::fbthrift::Deserialize::read(p)?;
14908 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14909 protocol: P::PROTOCOL_ID,
14910 method_name: METHOD_NAME.as_cstr(),
14911 buffer: ::std::marker::PhantomData, })?;
14913 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14914
14915 let res = ::std::panic::AssertUnwindSafe(
14916 self.service.chainAddEdges(
14917 _args.req,
14918 )
14919 )
14920 .catch_unwind()
14921 .await;
14922
14923 let res = match res {
14925 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14926 ::tracing::info!("success");
14927 crate::services::internal_storage_service::ChainAddEdgesExn::Success(res)
14928 }
14929 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::internal_storage_service::ChainAddEdgesExn::Success(_))) => {
14930 panic!(
14931 "{} attempted to return success via error",
14932 "chainAddEdges",
14933 )
14934 }
14935 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
14936 ::tracing::error!(exception = ?exn);
14937 exn
14938 }
14939 ::std::result::Result::Err(exn) => {
14940 let aexn = ::fbthrift::ApplicationException::handler_panic("InternalStorageService.chainAddEdges", exn);
14941 crate::services::internal_storage_service::ChainAddEdgesExn::ApplicationException(aexn)
14942 }
14943 };
14944
14945 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
14946 "chainAddEdges",
14947 METHOD_NAME.as_cstr(),
14948 _seqid,
14949 req_ctxt,
14950 &mut ctx_stack,
14951 res
14952 )?;
14953 reply_state.lock().unwrap().send_reply(env);
14954 Ok(())
14955 }
14956
14957 #[::tracing::instrument(skip_all, name = "handler", fields(method = "InternalStorageService.chainUpdateEdge"))]
14958 async fn handle_chainUpdateEdge<'a>(
14959 &'a self,
14960 p: &'a mut P::Deserializer,
14961 req_ctxt: &R,
14962 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
14963 _seqid: ::std::primitive::u32,
14964 ) -> ::anyhow::Result<()> {
14965 use ::const_cstr::const_cstr;
14966 use ::futures::FutureExt as _;
14967
14968 const_cstr! {
14969 SERVICE_NAME = "InternalStorageService";
14970 METHOD_NAME = "InternalStorageService.chainUpdateEdge";
14971 }
14972 let mut ctx_stack = req_ctxt.get_context_stack(
14973 SERVICE_NAME.as_cstr(),
14974 METHOD_NAME.as_cstr(),
14975 )?;
14976 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
14977 let _args: self::Args_InternalStorageService_chainUpdateEdge = ::fbthrift::Deserialize::read(p)?;
14978 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
14979 protocol: P::PROTOCOL_ID,
14980 method_name: METHOD_NAME.as_cstr(),
14981 buffer: ::std::marker::PhantomData, })?;
14983 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
14984
14985 let res = ::std::panic::AssertUnwindSafe(
14986 self.service.chainUpdateEdge(
14987 _args.req,
14988 )
14989 )
14990 .catch_unwind()
14991 .await;
14992
14993 let res = match res {
14995 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
14996 ::tracing::info!("success");
14997 crate::services::internal_storage_service::ChainUpdateEdgeExn::Success(res)
14998 }
14999 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::internal_storage_service::ChainUpdateEdgeExn::Success(_))) => {
15000 panic!(
15001 "{} attempted to return success via error",
15002 "chainUpdateEdge",
15003 )
15004 }
15005 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
15006 ::tracing::error!(exception = ?exn);
15007 exn
15008 }
15009 ::std::result::Result::Err(exn) => {
15010 let aexn = ::fbthrift::ApplicationException::handler_panic("InternalStorageService.chainUpdateEdge", exn);
15011 crate::services::internal_storage_service::ChainUpdateEdgeExn::ApplicationException(aexn)
15012 }
15013 };
15014
15015 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
15016 "chainUpdateEdge",
15017 METHOD_NAME.as_cstr(),
15018 _seqid,
15019 req_ctxt,
15020 &mut ctx_stack,
15021 res
15022 )?;
15023 reply_state.lock().unwrap().send_reply(env);
15024 Ok(())
15025 }
15026
15027 #[::tracing::instrument(skip_all, name = "handler", fields(method = "InternalStorageService.chainDeleteEdges"))]
15028 async fn handle_chainDeleteEdges<'a>(
15029 &'a self,
15030 p: &'a mut P::Deserializer,
15031 req_ctxt: &R,
15032 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
15033 _seqid: ::std::primitive::u32,
15034 ) -> ::anyhow::Result<()> {
15035 use ::const_cstr::const_cstr;
15036 use ::futures::FutureExt as _;
15037
15038 const_cstr! {
15039 SERVICE_NAME = "InternalStorageService";
15040 METHOD_NAME = "InternalStorageService.chainDeleteEdges";
15041 }
15042 let mut ctx_stack = req_ctxt.get_context_stack(
15043 SERVICE_NAME.as_cstr(),
15044 METHOD_NAME.as_cstr(),
15045 )?;
15046 ::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
15047 let _args: self::Args_InternalStorageService_chainDeleteEdges = ::fbthrift::Deserialize::read(p)?;
15048 ::fbthrift::ContextStack::on_read_data(&mut ctx_stack, &::fbthrift::SerializedMessage {
15049 protocol: P::PROTOCOL_ID,
15050 method_name: METHOD_NAME.as_cstr(),
15051 buffer: ::std::marker::PhantomData, })?;
15053 ::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
15054
15055 let res = ::std::panic::AssertUnwindSafe(
15056 self.service.chainDeleteEdges(
15057 _args.req,
15058 )
15059 )
15060 .catch_unwind()
15061 .await;
15062
15063 let res = match res {
15065 ::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
15066 ::tracing::info!("success");
15067 crate::services::internal_storage_service::ChainDeleteEdgesExn::Success(res)
15068 }
15069 ::std::result::Result::Ok(::std::result::Result::Err(crate::services::internal_storage_service::ChainDeleteEdgesExn::Success(_))) => {
15070 panic!(
15071 "{} attempted to return success via error",
15072 "chainDeleteEdges",
15073 )
15074 }
15075 ::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
15076 ::tracing::error!(exception = ?exn);
15077 exn
15078 }
15079 ::std::result::Result::Err(exn) => {
15080 let aexn = ::fbthrift::ApplicationException::handler_panic("InternalStorageService.chainDeleteEdges", exn);
15081 crate::services::internal_storage_service::ChainDeleteEdgesExn::ApplicationException(aexn)
15082 }
15083 };
15084
15085 let env = ::fbthrift::help::serialize_result_envelope::<P, R, _>(
15086 "chainDeleteEdges",
15087 METHOD_NAME.as_cstr(),
15088 _seqid,
15089 req_ctxt,
15090 &mut ctx_stack,
15091 res
15092 )?;
15093 reply_state.lock().unwrap().send_reply(env);
15094 Ok(())
15095 }
15096 }
15097
15098 #[::async_trait::async_trait]
15099 impl<P, H, R, RS> ::fbthrift::ServiceProcessor<P> for InternalStorageServiceProcessor<P, H, R, RS>
15100 where
15101 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
15102 P::Deserializer: ::std::marker::Send,
15103 H: InternalStorageService,
15104 P::Frame: ::std::marker::Send + 'static,
15105 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
15106 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
15107 + ::std::marker::Send + ::std::marker::Sync + 'static,
15108 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
15109 {
15110 type RequestContext = R;
15111 type ReplyState = RS;
15112
15113 #[inline]
15114 fn method_idx(&self, name: &[::std::primitive::u8]) -> ::std::result::Result<::std::primitive::usize, ::fbthrift::ApplicationException> {
15115 match name {
15116 b"chainAddEdges" => ::std::result::Result::Ok(0usize),
15117 b"chainUpdateEdge" => ::std::result::Result::Ok(1usize),
15118 b"chainDeleteEdges" => ::std::result::Result::Ok(2usize),
15119 _ => ::std::result::Result::Err(::fbthrift::ApplicationException::unknown_method()),
15120 }
15121 }
15122
15123 #[allow(clippy::match_single_binding)]
15124 async fn handle_method(
15125 &self,
15126 idx: ::std::primitive::usize,
15127 _p: &mut P::Deserializer,
15128 _r: &R,
15129 _reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
15130 _seqid: ::std::primitive::u32,
15131 ) -> ::anyhow::Result<()> {
15132 match idx {
15133 0usize => {
15134 self.handle_chainAddEdges(_p, _r, _reply_state, _seqid).await
15135 }
15136 1usize => {
15137 self.handle_chainUpdateEdge(_p, _r, _reply_state, _seqid).await
15138 }
15139 2usize => {
15140 self.handle_chainDeleteEdges(_p, _r, _reply_state, _seqid).await
15141 }
15142 bad => panic!(
15143 "{}: unexpected method idx {}",
15144 "InternalStorageServiceProcessor",
15145 bad
15146 ),
15147 }
15148 }
15149
15150 #[allow(clippy::match_single_binding)]
15151 #[inline]
15152 fn create_interaction_idx(&self, name: &str) -> ::anyhow::Result<::std::primitive::usize> {
15153 match name {
15154 _ => ::anyhow::bail!("Unknown interaction"),
15155 }
15156 }
15157
15158 #[allow(clippy::match_single_binding)]
15159 fn handle_create_interaction(
15160 &self,
15161 idx: ::std::primitive::usize,
15162 ) -> ::anyhow::Result<
15163 ::std::sync::Arc<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = Self::RequestContext, ReplyState = Self::ReplyState> + ::std::marker::Send + 'static>
15164 > {
15165 match idx {
15166 bad => panic!(
15167 "{}: unexpected method idx {}",
15168 "InternalStorageServiceProcessor",
15169 bad
15170 ),
15171 }
15172 }
15173 }
15174
15175 #[::async_trait::async_trait]
15176 impl<P, H, R, RS> ::fbthrift::ThriftService<P::Frame> for InternalStorageServiceProcessor<P, H, R, RS>
15177 where
15178 P: ::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
15179 P::Deserializer: ::std::marker::Send,
15180 P::Frame: ::std::marker::Send + 'static,
15181 H: InternalStorageService,
15182 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
15183 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = ::fbthrift::ProtocolDecoded<P>>
15184 + ::std::marker::Send + ::std::marker::Sync + 'static,
15185 RS: ::fbthrift::ReplyState<P::Frame, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
15186 {
15187 type Handler = H;
15188 type RequestContext = R;
15189 type ReplyState = RS;
15190
15191 #[tracing::instrument(level="trace", skip_all, fields(service = "InternalStorageService"))]
15192 async fn call(
15193 &self,
15194 req: ::fbthrift::ProtocolDecoded<P>,
15195 req_ctxt: &R,
15196 reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
15197 ) -> ::anyhow::Result<()> {
15198 use ::fbthrift::{BufExt as _, ProtocolReader as _, ServiceProcessor as _};
15199 let mut p = P::deserializer(req);
15200 let (idx, mty, seqid) = p.read_message_begin(|name| self.method_idx(name))?;
15201 if mty != ::fbthrift::MessageType::Call {
15202 return ::std::result::Result::Err(::std::convert::From::from(::fbthrift::ApplicationException::new(
15203 ::fbthrift::ApplicationExceptionErrorCode::InvalidMessageType,
15204 format!("message type {:?} not handled", mty)
15205 )));
15206 }
15207 let idx = match idx {
15208 ::std::result::Result::Ok(idx) => idx,
15209 ::std::result::Result::Err(_) => {
15210 let cur = P::into_buffer(p).reset();
15211 return self.supa.call(cur, req_ctxt, reply_state).await;
15212 }
15213 };
15214 self.handle_method(idx, &mut p, req_ctxt, reply_state, seqid).await?;
15215 p.read_message_end()?;
15216
15217 Ok(())
15218 }
15219
15220 fn create_interaction(
15221 &self,
15222 name: &str,
15223 ) -> ::anyhow::Result<
15224 ::std::sync::Arc<dyn ::fbthrift::ThriftService<P::Frame, Handler = (), RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>
15225 > {
15226 use ::fbthrift::{ServiceProcessor as _};
15227 let idx = self.create_interaction_idx(name);
15228 let idx = match idx {
15229 ::anyhow::Result::Ok(idx) => idx,
15230 ::anyhow::Result::Err(_) => {
15231 return self.supa.create_interaction(name);
15232 }
15233 };
15234 self.handle_create_interaction(idx)
15235 }
15236
15237 fn get_method_names(&self) -> &'static [&'static str] {
15238 &[
15239 "chainAddEdges",
15241 "chainUpdateEdge",
15242 "chainDeleteEdges",
15243 ]
15244 }
15245 }
15246
15247 #[::tracing::instrument(level="debug", skip_all, fields(proto = ?proto))]
15252 pub fn make_InternalStorageService_server<F, H, R, RS>(
15253 proto: ::fbthrift::ProtocolID,
15254 handler: H,
15255 ) -> ::std::result::Result<::std::boxed::Box<dyn ::fbthrift::ThriftService<F, Handler = H, RequestContext = R, ReplyState = RS> + ::std::marker::Send + 'static>, ::fbthrift::ApplicationException>
15256 where
15257 F: ::fbthrift::Framing + ::std::marker::Send + ::std::marker::Sync + 'static,
15258 H: InternalStorageService,
15259 R: ::fbthrift::RequestContext<Name = ::std::ffi::CStr> + ::std::marker::Send + ::std::marker::Sync + 'static,
15260 <R as ::fbthrift::RequestContext>::ContextStack: ::fbthrift::ContextStack<Name = R::Name, Buffer = F::DecBuf> + ::std::marker::Send + ::std::marker::Sync + 'static,
15261 RS: ::fbthrift::ReplyState<F, RequestContext = R> + ::std::marker::Send + ::std::marker::Sync + 'static
15262 {
15263 match proto {
15264 ::fbthrift::ProtocolID::BinaryProtocol => {
15265 ::std::result::Result::Ok(::std::boxed::Box::new(InternalStorageServiceProcessor::<::fbthrift::BinaryProtocol<F>, H, R, RS>::new(handler)))
15266 }
15267 ::fbthrift::ProtocolID::CompactProtocol => {
15268 ::std::result::Result::Ok(::std::boxed::Box::new(InternalStorageServiceProcessor::<::fbthrift::CompactProtocol<F>, H, R, RS>::new(handler)))
15269 }
15270 bad => {
15271 ::tracing::error!(method = "InternalStorageService.", invalid_protocol = ?bad);
15272 ::std::result::Result::Err(::fbthrift::ApplicationException::invalid_protocol(bad))
15273 }
15274 }
15275 }
15276}
15277
15278pub mod mock {
15372 pub struct GraphStorageService<'mock> {
15373 pub getNeighbors: r#impl::graph_storage_service::getNeighbors<'mock>,
15374 pub getDstBySrc: r#impl::graph_storage_service::getDstBySrc<'mock>,
15375 pub getProps: r#impl::graph_storage_service::getProps<'mock>,
15376 pub addVertices: r#impl::graph_storage_service::addVertices<'mock>,
15377 pub addEdges: r#impl::graph_storage_service::addEdges<'mock>,
15378 pub deleteEdges: r#impl::graph_storage_service::deleteEdges<'mock>,
15379 pub deleteVertices: r#impl::graph_storage_service::deleteVertices<'mock>,
15380 pub deleteTags: r#impl::graph_storage_service::deleteTags<'mock>,
15381 pub updateVertex: r#impl::graph_storage_service::updateVertex<'mock>,
15382 pub updateEdge: r#impl::graph_storage_service::updateEdge<'mock>,
15383 pub scanVertex: r#impl::graph_storage_service::scanVertex<'mock>,
15384 pub scanEdge: r#impl::graph_storage_service::scanEdge<'mock>,
15385 pub getUUID: r#impl::graph_storage_service::getUUID<'mock>,
15386 pub lookupIndex: r#impl::graph_storage_service::lookupIndex<'mock>,
15387 pub lookupAndTraverse: r#impl::graph_storage_service::lookupAndTraverse<'mock>,
15388 pub chainUpdateEdge: r#impl::graph_storage_service::chainUpdateEdge<'mock>,
15389 pub chainAddEdges: r#impl::graph_storage_service::chainAddEdges<'mock>,
15390 pub chainDeleteEdges: r#impl::graph_storage_service::chainDeleteEdges<'mock>,
15391 pub get: r#impl::graph_storage_service::get<'mock>,
15392 pub put: r#impl::graph_storage_service::put<'mock>,
15393 pub remove: r#impl::graph_storage_service::remove<'mock>,
15394 _marker: ::std::marker::PhantomData<&'mock ()>,
15395 }
15396
15397 impl dyn super::client::GraphStorageService {
15398 pub fn mock<'mock>() -> GraphStorageService<'mock> {
15399 GraphStorageService {
15400 getNeighbors: r#impl::graph_storage_service::getNeighbors::unimplemented(),
15401 getDstBySrc: r#impl::graph_storage_service::getDstBySrc::unimplemented(),
15402 getProps: r#impl::graph_storage_service::getProps::unimplemented(),
15403 addVertices: r#impl::graph_storage_service::addVertices::unimplemented(),
15404 addEdges: r#impl::graph_storage_service::addEdges::unimplemented(),
15405 deleteEdges: r#impl::graph_storage_service::deleteEdges::unimplemented(),
15406 deleteVertices: r#impl::graph_storage_service::deleteVertices::unimplemented(),
15407 deleteTags: r#impl::graph_storage_service::deleteTags::unimplemented(),
15408 updateVertex: r#impl::graph_storage_service::updateVertex::unimplemented(),
15409 updateEdge: r#impl::graph_storage_service::updateEdge::unimplemented(),
15410 scanVertex: r#impl::graph_storage_service::scanVertex::unimplemented(),
15411 scanEdge: r#impl::graph_storage_service::scanEdge::unimplemented(),
15412 getUUID: r#impl::graph_storage_service::getUUID::unimplemented(),
15413 lookupIndex: r#impl::graph_storage_service::lookupIndex::unimplemented(),
15414 lookupAndTraverse: r#impl::graph_storage_service::lookupAndTraverse::unimplemented(),
15415 chainUpdateEdge: r#impl::graph_storage_service::chainUpdateEdge::unimplemented(),
15416 chainAddEdges: r#impl::graph_storage_service::chainAddEdges::unimplemented(),
15417 chainDeleteEdges: r#impl::graph_storage_service::chainDeleteEdges::unimplemented(),
15418 get: r#impl::graph_storage_service::get::unimplemented(),
15419 put: r#impl::graph_storage_service::put::unimplemented(),
15420 remove: r#impl::graph_storage_service::remove::unimplemented(),
15421 _marker: ::std::marker::PhantomData,
15422 }
15423 }
15424 }
15425
15426 impl<'mock> super::client::GraphStorageService for GraphStorageService<'mock> {
15427 fn getNeighbors(
15428 &self,
15429 arg_req: &crate::types::GetNeighborsRequest,
15430 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError>> {
15431 let mut closure = self.getNeighbors.closure.lock().unwrap();
15432 let closure: &mut dyn ::std::ops::FnMut(crate::types::GetNeighborsRequest) -> _ = &mut **closure;
15433 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15434 }
15435 fn getDstBySrc(
15436 &self,
15437 arg_req: &crate::types::GetDstBySrcRequest,
15438 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError>> {
15439 let mut closure = self.getDstBySrc.closure.lock().unwrap();
15440 let closure: &mut dyn ::std::ops::FnMut(crate::types::GetDstBySrcRequest) -> _ = &mut **closure;
15441 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15442 }
15443 fn getProps(
15444 &self,
15445 arg_req: &crate::types::GetPropRequest,
15446 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError>> {
15447 let mut closure = self.getProps.closure.lock().unwrap();
15448 let closure: &mut dyn ::std::ops::FnMut(crate::types::GetPropRequest) -> _ = &mut **closure;
15449 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15450 }
15451 fn addVertices(
15452 &self,
15453 arg_req: &crate::types::AddVerticesRequest,
15454 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError>> {
15455 let mut closure = self.addVertices.closure.lock().unwrap();
15456 let closure: &mut dyn ::std::ops::FnMut(crate::types::AddVerticesRequest) -> _ = &mut **closure;
15457 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15458 }
15459 fn addEdges(
15460 &self,
15461 arg_req: &crate::types::AddEdgesRequest,
15462 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError>> {
15463 let mut closure = self.addEdges.closure.lock().unwrap();
15464 let closure: &mut dyn ::std::ops::FnMut(crate::types::AddEdgesRequest) -> _ = &mut **closure;
15465 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15466 }
15467 fn deleteEdges(
15468 &self,
15469 arg_req: &crate::types::DeleteEdgesRequest,
15470 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError>> {
15471 let mut closure = self.deleteEdges.closure.lock().unwrap();
15472 let closure: &mut dyn ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> _ = &mut **closure;
15473 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15474 }
15475 fn deleteVertices(
15476 &self,
15477 arg_req: &crate::types::DeleteVerticesRequest,
15478 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError>> {
15479 let mut closure = self.deleteVertices.closure.lock().unwrap();
15480 let closure: &mut dyn ::std::ops::FnMut(crate::types::DeleteVerticesRequest) -> _ = &mut **closure;
15481 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15482 }
15483 fn deleteTags(
15484 &self,
15485 arg_req: &crate::types::DeleteTagsRequest,
15486 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError>> {
15487 let mut closure = self.deleteTags.closure.lock().unwrap();
15488 let closure: &mut dyn ::std::ops::FnMut(crate::types::DeleteTagsRequest) -> _ = &mut **closure;
15489 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15490 }
15491 fn updateVertex(
15492 &self,
15493 arg_req: &crate::types::UpdateVertexRequest,
15494 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError>> {
15495 let mut closure = self.updateVertex.closure.lock().unwrap();
15496 let closure: &mut dyn ::std::ops::FnMut(crate::types::UpdateVertexRequest) -> _ = &mut **closure;
15497 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15498 }
15499 fn updateEdge(
15500 &self,
15501 arg_req: &crate::types::UpdateEdgeRequest,
15502 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError>> {
15503 let mut closure = self.updateEdge.closure.lock().unwrap();
15504 let closure: &mut dyn ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> _ = &mut **closure;
15505 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15506 }
15507 fn scanVertex(
15508 &self,
15509 arg_req: &crate::types::ScanVertexRequest,
15510 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError>> {
15511 let mut closure = self.scanVertex.closure.lock().unwrap();
15512 let closure: &mut dyn ::std::ops::FnMut(crate::types::ScanVertexRequest) -> _ = &mut **closure;
15513 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15514 }
15515 fn scanEdge(
15516 &self,
15517 arg_req: &crate::types::ScanEdgeRequest,
15518 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError>> {
15519 let mut closure = self.scanEdge.closure.lock().unwrap();
15520 let closure: &mut dyn ::std::ops::FnMut(crate::types::ScanEdgeRequest) -> _ = &mut **closure;
15521 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15522 }
15523 fn getUUID(
15524 &self,
15525 arg_req: &crate::types::GetUUIDReq,
15526 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError>> {
15527 let mut closure = self.getUUID.closure.lock().unwrap();
15528 let closure: &mut dyn ::std::ops::FnMut(crate::types::GetUUIDReq) -> _ = &mut **closure;
15529 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15530 }
15531 fn lookupIndex(
15532 &self,
15533 arg_req: &crate::types::LookupIndexRequest,
15534 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError>> {
15535 let mut closure = self.lookupIndex.closure.lock().unwrap();
15536 let closure: &mut dyn ::std::ops::FnMut(crate::types::LookupIndexRequest) -> _ = &mut **closure;
15537 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15538 }
15539 fn lookupAndTraverse(
15540 &self,
15541 arg_req: &crate::types::LookupAndTraverseRequest,
15542 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError>> {
15543 let mut closure = self.lookupAndTraverse.closure.lock().unwrap();
15544 let closure: &mut dyn ::std::ops::FnMut(crate::types::LookupAndTraverseRequest) -> _ = &mut **closure;
15545 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15546 }
15547 fn chainUpdateEdge(
15548 &self,
15549 arg_req: &crate::types::UpdateEdgeRequest,
15550 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError>> {
15551 let mut closure = self.chainUpdateEdge.closure.lock().unwrap();
15552 let closure: &mut dyn ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> _ = &mut **closure;
15553 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15554 }
15555 fn chainAddEdges(
15556 &self,
15557 arg_req: &crate::types::AddEdgesRequest,
15558 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError>> {
15559 let mut closure = self.chainAddEdges.closure.lock().unwrap();
15560 let closure: &mut dyn ::std::ops::FnMut(crate::types::AddEdgesRequest) -> _ = &mut **closure;
15561 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15562 }
15563 fn chainDeleteEdges(
15564 &self,
15565 arg_req: &crate::types::DeleteEdgesRequest,
15566 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError>> {
15567 let mut closure = self.chainDeleteEdges.closure.lock().unwrap();
15568 let closure: &mut dyn ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> _ = &mut **closure;
15569 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15570 }
15571 fn get(
15572 &self,
15573 arg_req: &crate::types::KVGetRequest,
15574 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError>> {
15575 let mut closure = self.get.closure.lock().unwrap();
15576 let closure: &mut dyn ::std::ops::FnMut(crate::types::KVGetRequest) -> _ = &mut **closure;
15577 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15578 }
15579 fn put(
15580 &self,
15581 arg_req: &crate::types::KVPutRequest,
15582 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError>> {
15583 let mut closure = self.put.closure.lock().unwrap();
15584 let closure: &mut dyn ::std::ops::FnMut(crate::types::KVPutRequest) -> _ = &mut **closure;
15585 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15586 }
15587 fn remove(
15588 &self,
15589 arg_req: &crate::types::KVRemoveRequest,
15590 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError>> {
15591 let mut closure = self.remove.closure.lock().unwrap();
15592 let closure: &mut dyn ::std::ops::FnMut(crate::types::KVRemoveRequest) -> _ = &mut **closure;
15593 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15594 }
15595 }
15596
15597
15598 pub struct StorageAdminService<'mock> {
15599 pub transLeader: r#impl::storage_admin_service::transLeader<'mock>,
15600 pub addPart: r#impl::storage_admin_service::addPart<'mock>,
15601 pub addLearner: r#impl::storage_admin_service::addLearner<'mock>,
15602 pub removePart: r#impl::storage_admin_service::removePart<'mock>,
15603 pub memberChange: r#impl::storage_admin_service::memberChange<'mock>,
15604 pub waitingForCatchUpData: r#impl::storage_admin_service::waitingForCatchUpData<'mock>,
15605 pub createCheckpoint: r#impl::storage_admin_service::createCheckpoint<'mock>,
15606 pub dropCheckpoint: r#impl::storage_admin_service::dropCheckpoint<'mock>,
15607 pub blockingWrites: r#impl::storage_admin_service::blockingWrites<'mock>,
15608 pub getLeaderParts: r#impl::storage_admin_service::getLeaderParts<'mock>,
15609 pub checkPeers: r#impl::storage_admin_service::checkPeers<'mock>,
15610 pub addAdminTask: r#impl::storage_admin_service::addAdminTask<'mock>,
15611 pub stopAdminTask: r#impl::storage_admin_service::stopAdminTask<'mock>,
15612 pub clearSpace: r#impl::storage_admin_service::clearSpace<'mock>,
15613 _marker: ::std::marker::PhantomData<&'mock ()>,
15614 }
15615
15616 impl dyn super::client::StorageAdminService {
15617 pub fn mock<'mock>() -> StorageAdminService<'mock> {
15618 StorageAdminService {
15619 transLeader: r#impl::storage_admin_service::transLeader::unimplemented(),
15620 addPart: r#impl::storage_admin_service::addPart::unimplemented(),
15621 addLearner: r#impl::storage_admin_service::addLearner::unimplemented(),
15622 removePart: r#impl::storage_admin_service::removePart::unimplemented(),
15623 memberChange: r#impl::storage_admin_service::memberChange::unimplemented(),
15624 waitingForCatchUpData: r#impl::storage_admin_service::waitingForCatchUpData::unimplemented(),
15625 createCheckpoint: r#impl::storage_admin_service::createCheckpoint::unimplemented(),
15626 dropCheckpoint: r#impl::storage_admin_service::dropCheckpoint::unimplemented(),
15627 blockingWrites: r#impl::storage_admin_service::blockingWrites::unimplemented(),
15628 getLeaderParts: r#impl::storage_admin_service::getLeaderParts::unimplemented(),
15629 checkPeers: r#impl::storage_admin_service::checkPeers::unimplemented(),
15630 addAdminTask: r#impl::storage_admin_service::addAdminTask::unimplemented(),
15631 stopAdminTask: r#impl::storage_admin_service::stopAdminTask::unimplemented(),
15632 clearSpace: r#impl::storage_admin_service::clearSpace::unimplemented(),
15633 _marker: ::std::marker::PhantomData,
15634 }
15635 }
15636 }
15637
15638 impl<'mock> super::client::StorageAdminService for StorageAdminService<'mock> {
15639 fn transLeader(
15640 &self,
15641 arg_req: &crate::types::TransLeaderReq,
15642 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError>> {
15643 let mut closure = self.transLeader.closure.lock().unwrap();
15644 let closure: &mut dyn ::std::ops::FnMut(crate::types::TransLeaderReq) -> _ = &mut **closure;
15645 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15646 }
15647 fn addPart(
15648 &self,
15649 arg_req: &crate::types::AddPartReq,
15650 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError>> {
15651 let mut closure = self.addPart.closure.lock().unwrap();
15652 let closure: &mut dyn ::std::ops::FnMut(crate::types::AddPartReq) -> _ = &mut **closure;
15653 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15654 }
15655 fn addLearner(
15656 &self,
15657 arg_req: &crate::types::AddLearnerReq,
15658 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError>> {
15659 let mut closure = self.addLearner.closure.lock().unwrap();
15660 let closure: &mut dyn ::std::ops::FnMut(crate::types::AddLearnerReq) -> _ = &mut **closure;
15661 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15662 }
15663 fn removePart(
15664 &self,
15665 arg_req: &crate::types::RemovePartReq,
15666 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError>> {
15667 let mut closure = self.removePart.closure.lock().unwrap();
15668 let closure: &mut dyn ::std::ops::FnMut(crate::types::RemovePartReq) -> _ = &mut **closure;
15669 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15670 }
15671 fn memberChange(
15672 &self,
15673 arg_req: &crate::types::MemberChangeReq,
15674 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError>> {
15675 let mut closure = self.memberChange.closure.lock().unwrap();
15676 let closure: &mut dyn ::std::ops::FnMut(crate::types::MemberChangeReq) -> _ = &mut **closure;
15677 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15678 }
15679 fn waitingForCatchUpData(
15680 &self,
15681 arg_req: &crate::types::CatchUpDataReq,
15682 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError>> {
15683 let mut closure = self.waitingForCatchUpData.closure.lock().unwrap();
15684 let closure: &mut dyn ::std::ops::FnMut(crate::types::CatchUpDataReq) -> _ = &mut **closure;
15685 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15686 }
15687 fn createCheckpoint(
15688 &self,
15689 arg_req: &crate::types::CreateCPRequest,
15690 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError>> {
15691 let mut closure = self.createCheckpoint.closure.lock().unwrap();
15692 let closure: &mut dyn ::std::ops::FnMut(crate::types::CreateCPRequest) -> _ = &mut **closure;
15693 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15694 }
15695 fn dropCheckpoint(
15696 &self,
15697 arg_req: &crate::types::DropCPRequest,
15698 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError>> {
15699 let mut closure = self.dropCheckpoint.closure.lock().unwrap();
15700 let closure: &mut dyn ::std::ops::FnMut(crate::types::DropCPRequest) -> _ = &mut **closure;
15701 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15702 }
15703 fn blockingWrites(
15704 &self,
15705 arg_req: &crate::types::BlockingSignRequest,
15706 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError>> {
15707 let mut closure = self.blockingWrites.closure.lock().unwrap();
15708 let closure: &mut dyn ::std::ops::FnMut(crate::types::BlockingSignRequest) -> _ = &mut **closure;
15709 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15710 }
15711 fn getLeaderParts(
15712 &self,
15713 arg_req: &crate::types::GetLeaderReq,
15714 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError>> {
15715 let mut closure = self.getLeaderParts.closure.lock().unwrap();
15716 let closure: &mut dyn ::std::ops::FnMut(crate::types::GetLeaderReq) -> _ = &mut **closure;
15717 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15718 }
15719 fn checkPeers(
15720 &self,
15721 arg_req: &crate::types::CheckPeersReq,
15722 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError>> {
15723 let mut closure = self.checkPeers.closure.lock().unwrap();
15724 let closure: &mut dyn ::std::ops::FnMut(crate::types::CheckPeersReq) -> _ = &mut **closure;
15725 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15726 }
15727 fn addAdminTask(
15728 &self,
15729 arg_req: &crate::types::AddTaskRequest,
15730 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError>> {
15731 let mut closure = self.addAdminTask.closure.lock().unwrap();
15732 let closure: &mut dyn ::std::ops::FnMut(crate::types::AddTaskRequest) -> _ = &mut **closure;
15733 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15734 }
15735 fn stopAdminTask(
15736 &self,
15737 arg_req: &crate::types::StopTaskRequest,
15738 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError>> {
15739 let mut closure = self.stopAdminTask.closure.lock().unwrap();
15740 let closure: &mut dyn ::std::ops::FnMut(crate::types::StopTaskRequest) -> _ = &mut **closure;
15741 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15742 }
15743 fn clearSpace(
15744 &self,
15745 arg_req: &crate::types::ClearSpaceReq,
15746 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError>> {
15747 let mut closure = self.clearSpace.closure.lock().unwrap();
15748 let closure: &mut dyn ::std::ops::FnMut(crate::types::ClearSpaceReq) -> _ = &mut **closure;
15749 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15750 }
15751 }
15752
15753
15754 pub struct InternalStorageService<'mock> {
15755 pub chainAddEdges: r#impl::internal_storage_service::chainAddEdges<'mock>,
15756 pub chainUpdateEdge: r#impl::internal_storage_service::chainUpdateEdge<'mock>,
15757 pub chainDeleteEdges: r#impl::internal_storage_service::chainDeleteEdges<'mock>,
15758 _marker: ::std::marker::PhantomData<&'mock ()>,
15759 }
15760
15761 impl dyn super::client::InternalStorageService {
15762 pub fn mock<'mock>() -> InternalStorageService<'mock> {
15763 InternalStorageService {
15764 chainAddEdges: r#impl::internal_storage_service::chainAddEdges::unimplemented(),
15765 chainUpdateEdge: r#impl::internal_storage_service::chainUpdateEdge::unimplemented(),
15766 chainDeleteEdges: r#impl::internal_storage_service::chainDeleteEdges::unimplemented(),
15767 _marker: ::std::marker::PhantomData,
15768 }
15769 }
15770 }
15771
15772 impl<'mock> super::client::InternalStorageService for InternalStorageService<'mock> {
15773 fn chainAddEdges(
15774 &self,
15775 arg_req: &crate::types::ChainAddEdgesRequest,
15776 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError>> {
15777 let mut closure = self.chainAddEdges.closure.lock().unwrap();
15778 let closure: &mut dyn ::std::ops::FnMut(crate::types::ChainAddEdgesRequest) -> _ = &mut **closure;
15779 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15780 }
15781 fn chainUpdateEdge(
15782 &self,
15783 arg_req: &crate::types::ChainUpdateEdgeRequest,
15784 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError>> {
15785 let mut closure = self.chainUpdateEdge.closure.lock().unwrap();
15786 let closure: &mut dyn ::std::ops::FnMut(crate::types::ChainUpdateEdgeRequest) -> _ = &mut **closure;
15787 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15788 }
15789 fn chainDeleteEdges(
15790 &self,
15791 arg_req: &crate::types::ChainDeleteEdgesRequest,
15792 ) -> ::futures::future::BoxFuture<'static, ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError>> {
15793 let mut closure = self.chainDeleteEdges.closure.lock().unwrap();
15794 let closure: &mut dyn ::std::ops::FnMut(crate::types::ChainDeleteEdgesRequest) -> _ = &mut **closure;
15795 ::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
15796 }
15797 }
15798
15799 mod r#impl {
15800 pub mod graph_storage_service {
15801
15802 pub struct getNeighbors<'mock> {
15803 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
15804 dyn ::std::ops::FnMut(crate::types::GetNeighborsRequest) -> ::std::result::Result<
15805 crate::types::GetNeighborsResponse,
15806 crate::errors::graph_storage_service::GetNeighborsError,
15807 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
15808 >>,
15809 }
15810
15811 #[allow(clippy::redundant_closure)]
15812 impl<'mock> getNeighbors<'mock> {
15813 pub fn unimplemented() -> Self {
15814 Self {
15815 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::GetNeighborsRequest| panic!(
15816 "{}::{} is not mocked",
15817 "GraphStorageService",
15818 "getNeighbors",
15819 ))),
15820 }
15821 }
15822
15823 pub fn ret(&self, value: crate::types::GetNeighborsResponse) {
15824 self.mock(move |_: crate::types::GetNeighborsRequest| value.clone());
15825 }
15826
15827 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetNeighborsRequest) -> crate::types::GetNeighborsResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15828 let mut closure = self.closure.lock().unwrap();
15829 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
15830 }
15831
15832 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetNeighborsRequest) -> ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::GetNeighborsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15833 let mut closure = self.closure.lock().unwrap();
15834 *closure = ::std::boxed::Box::new(move |req| mock(req));
15835 }
15836
15837 pub fn throw<E>(&self, exception: E)
15838 where
15839 E: ::std::convert::Into<crate::errors::graph_storage_service::GetNeighborsError>,
15840 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
15841 {
15842 let mut closure = self.closure.lock().unwrap();
15843 *closure = ::std::boxed::Box::new(move |_: crate::types::GetNeighborsRequest| ::std::result::Result::Err(exception.clone().into()));
15844 }
15845 }
15846
15847 pub struct getDstBySrc<'mock> {
15848 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
15849 dyn ::std::ops::FnMut(crate::types::GetDstBySrcRequest) -> ::std::result::Result<
15850 crate::types::GetDstBySrcResponse,
15851 crate::errors::graph_storage_service::GetDstBySrcError,
15852 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
15853 >>,
15854 }
15855
15856 #[allow(clippy::redundant_closure)]
15857 impl<'mock> getDstBySrc<'mock> {
15858 pub fn unimplemented() -> Self {
15859 Self {
15860 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::GetDstBySrcRequest| panic!(
15861 "{}::{} is not mocked",
15862 "GraphStorageService",
15863 "getDstBySrc",
15864 ))),
15865 }
15866 }
15867
15868 pub fn ret(&self, value: crate::types::GetDstBySrcResponse) {
15869 self.mock(move |_: crate::types::GetDstBySrcRequest| value.clone());
15870 }
15871
15872 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetDstBySrcRequest) -> crate::types::GetDstBySrcResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15873 let mut closure = self.closure.lock().unwrap();
15874 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
15875 }
15876
15877 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetDstBySrcRequest) -> ::std::result::Result<crate::types::GetDstBySrcResponse, crate::errors::graph_storage_service::GetDstBySrcError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15878 let mut closure = self.closure.lock().unwrap();
15879 *closure = ::std::boxed::Box::new(move |req| mock(req));
15880 }
15881
15882 pub fn throw<E>(&self, exception: E)
15883 where
15884 E: ::std::convert::Into<crate::errors::graph_storage_service::GetDstBySrcError>,
15885 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
15886 {
15887 let mut closure = self.closure.lock().unwrap();
15888 *closure = ::std::boxed::Box::new(move |_: crate::types::GetDstBySrcRequest| ::std::result::Result::Err(exception.clone().into()));
15889 }
15890 }
15891
15892 pub struct getProps<'mock> {
15893 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
15894 dyn ::std::ops::FnMut(crate::types::GetPropRequest) -> ::std::result::Result<
15895 crate::types::GetPropResponse,
15896 crate::errors::graph_storage_service::GetPropsError,
15897 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
15898 >>,
15899 }
15900
15901 #[allow(clippy::redundant_closure)]
15902 impl<'mock> getProps<'mock> {
15903 pub fn unimplemented() -> Self {
15904 Self {
15905 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::GetPropRequest| panic!(
15906 "{}::{} is not mocked",
15907 "GraphStorageService",
15908 "getProps",
15909 ))),
15910 }
15911 }
15912
15913 pub fn ret(&self, value: crate::types::GetPropResponse) {
15914 self.mock(move |_: crate::types::GetPropRequest| value.clone());
15915 }
15916
15917 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetPropRequest) -> crate::types::GetPropResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15918 let mut closure = self.closure.lock().unwrap();
15919 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
15920 }
15921
15922 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetPropRequest) -> ::std::result::Result<crate::types::GetPropResponse, crate::errors::graph_storage_service::GetPropsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15923 let mut closure = self.closure.lock().unwrap();
15924 *closure = ::std::boxed::Box::new(move |req| mock(req));
15925 }
15926
15927 pub fn throw<E>(&self, exception: E)
15928 where
15929 E: ::std::convert::Into<crate::errors::graph_storage_service::GetPropsError>,
15930 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
15931 {
15932 let mut closure = self.closure.lock().unwrap();
15933 *closure = ::std::boxed::Box::new(move |_: crate::types::GetPropRequest| ::std::result::Result::Err(exception.clone().into()));
15934 }
15935 }
15936
15937 pub struct addVertices<'mock> {
15938 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
15939 dyn ::std::ops::FnMut(crate::types::AddVerticesRequest) -> ::std::result::Result<
15940 crate::types::ExecResponse,
15941 crate::errors::graph_storage_service::AddVerticesError,
15942 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
15943 >>,
15944 }
15945
15946 #[allow(clippy::redundant_closure)]
15947 impl<'mock> addVertices<'mock> {
15948 pub fn unimplemented() -> Self {
15949 Self {
15950 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::AddVerticesRequest| panic!(
15951 "{}::{} is not mocked",
15952 "GraphStorageService",
15953 "addVertices",
15954 ))),
15955 }
15956 }
15957
15958 pub fn ret(&self, value: crate::types::ExecResponse) {
15959 self.mock(move |_: crate::types::AddVerticesRequest| value.clone());
15960 }
15961
15962 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddVerticesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15963 let mut closure = self.closure.lock().unwrap();
15964 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
15965 }
15966
15967 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddVerticesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddVerticesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
15968 let mut closure = self.closure.lock().unwrap();
15969 *closure = ::std::boxed::Box::new(move |req| mock(req));
15970 }
15971
15972 pub fn throw<E>(&self, exception: E)
15973 where
15974 E: ::std::convert::Into<crate::errors::graph_storage_service::AddVerticesError>,
15975 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
15976 {
15977 let mut closure = self.closure.lock().unwrap();
15978 *closure = ::std::boxed::Box::new(move |_: crate::types::AddVerticesRequest| ::std::result::Result::Err(exception.clone().into()));
15979 }
15980 }
15981
15982 pub struct addEdges<'mock> {
15983 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
15984 dyn ::std::ops::FnMut(crate::types::AddEdgesRequest) -> ::std::result::Result<
15985 crate::types::ExecResponse,
15986 crate::errors::graph_storage_service::AddEdgesError,
15987 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
15988 >>,
15989 }
15990
15991 #[allow(clippy::redundant_closure)]
15992 impl<'mock> addEdges<'mock> {
15993 pub fn unimplemented() -> Self {
15994 Self {
15995 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::AddEdgesRequest| panic!(
15996 "{}::{} is not mocked",
15997 "GraphStorageService",
15998 "addEdges",
15999 ))),
16000 }
16001 }
16002
16003 pub fn ret(&self, value: crate::types::ExecResponse) {
16004 self.mock(move |_: crate::types::AddEdgesRequest| value.clone());
16005 }
16006
16007 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddEdgesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16008 let mut closure = self.closure.lock().unwrap();
16009 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16010 }
16011
16012 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddEdgesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::AddEdgesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16013 let mut closure = self.closure.lock().unwrap();
16014 *closure = ::std::boxed::Box::new(move |req| mock(req));
16015 }
16016
16017 pub fn throw<E>(&self, exception: E)
16018 where
16019 E: ::std::convert::Into<crate::errors::graph_storage_service::AddEdgesError>,
16020 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16021 {
16022 let mut closure = self.closure.lock().unwrap();
16023 *closure = ::std::boxed::Box::new(move |_: crate::types::AddEdgesRequest| ::std::result::Result::Err(exception.clone().into()));
16024 }
16025 }
16026
16027 pub struct deleteEdges<'mock> {
16028 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16029 dyn ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> ::std::result::Result<
16030 crate::types::ExecResponse,
16031 crate::errors::graph_storage_service::DeleteEdgesError,
16032 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16033 >>,
16034 }
16035
16036 #[allow(clippy::redundant_closure)]
16037 impl<'mock> deleteEdges<'mock> {
16038 pub fn unimplemented() -> Self {
16039 Self {
16040 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::DeleteEdgesRequest| panic!(
16041 "{}::{} is not mocked",
16042 "GraphStorageService",
16043 "deleteEdges",
16044 ))),
16045 }
16046 }
16047
16048 pub fn ret(&self, value: crate::types::ExecResponse) {
16049 self.mock(move |_: crate::types::DeleteEdgesRequest| value.clone());
16050 }
16051
16052 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16053 let mut closure = self.closure.lock().unwrap();
16054 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16055 }
16056
16057 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteEdgesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16058 let mut closure = self.closure.lock().unwrap();
16059 *closure = ::std::boxed::Box::new(move |req| mock(req));
16060 }
16061
16062 pub fn throw<E>(&self, exception: E)
16063 where
16064 E: ::std::convert::Into<crate::errors::graph_storage_service::DeleteEdgesError>,
16065 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16066 {
16067 let mut closure = self.closure.lock().unwrap();
16068 *closure = ::std::boxed::Box::new(move |_: crate::types::DeleteEdgesRequest| ::std::result::Result::Err(exception.clone().into()));
16069 }
16070 }
16071
16072 pub struct deleteVertices<'mock> {
16073 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16074 dyn ::std::ops::FnMut(crate::types::DeleteVerticesRequest) -> ::std::result::Result<
16075 crate::types::ExecResponse,
16076 crate::errors::graph_storage_service::DeleteVerticesError,
16077 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16078 >>,
16079 }
16080
16081 #[allow(clippy::redundant_closure)]
16082 impl<'mock> deleteVertices<'mock> {
16083 pub fn unimplemented() -> Self {
16084 Self {
16085 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::DeleteVerticesRequest| panic!(
16086 "{}::{} is not mocked",
16087 "GraphStorageService",
16088 "deleteVertices",
16089 ))),
16090 }
16091 }
16092
16093 pub fn ret(&self, value: crate::types::ExecResponse) {
16094 self.mock(move |_: crate::types::DeleteVerticesRequest| value.clone());
16095 }
16096
16097 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteVerticesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16098 let mut closure = self.closure.lock().unwrap();
16099 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16100 }
16101
16102 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteVerticesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteVerticesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16103 let mut closure = self.closure.lock().unwrap();
16104 *closure = ::std::boxed::Box::new(move |req| mock(req));
16105 }
16106
16107 pub fn throw<E>(&self, exception: E)
16108 where
16109 E: ::std::convert::Into<crate::errors::graph_storage_service::DeleteVerticesError>,
16110 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16111 {
16112 let mut closure = self.closure.lock().unwrap();
16113 *closure = ::std::boxed::Box::new(move |_: crate::types::DeleteVerticesRequest| ::std::result::Result::Err(exception.clone().into()));
16114 }
16115 }
16116
16117 pub struct deleteTags<'mock> {
16118 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16119 dyn ::std::ops::FnMut(crate::types::DeleteTagsRequest) -> ::std::result::Result<
16120 crate::types::ExecResponse,
16121 crate::errors::graph_storage_service::DeleteTagsError,
16122 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16123 >>,
16124 }
16125
16126 #[allow(clippy::redundant_closure)]
16127 impl<'mock> deleteTags<'mock> {
16128 pub fn unimplemented() -> Self {
16129 Self {
16130 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::DeleteTagsRequest| panic!(
16131 "{}::{} is not mocked",
16132 "GraphStorageService",
16133 "deleteTags",
16134 ))),
16135 }
16136 }
16137
16138 pub fn ret(&self, value: crate::types::ExecResponse) {
16139 self.mock(move |_: crate::types::DeleteTagsRequest| value.clone());
16140 }
16141
16142 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteTagsRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16143 let mut closure = self.closure.lock().unwrap();
16144 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16145 }
16146
16147 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteTagsRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::DeleteTagsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16148 let mut closure = self.closure.lock().unwrap();
16149 *closure = ::std::boxed::Box::new(move |req| mock(req));
16150 }
16151
16152 pub fn throw<E>(&self, exception: E)
16153 where
16154 E: ::std::convert::Into<crate::errors::graph_storage_service::DeleteTagsError>,
16155 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16156 {
16157 let mut closure = self.closure.lock().unwrap();
16158 *closure = ::std::boxed::Box::new(move |_: crate::types::DeleteTagsRequest| ::std::result::Result::Err(exception.clone().into()));
16159 }
16160 }
16161
16162 pub struct updateVertex<'mock> {
16163 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16164 dyn ::std::ops::FnMut(crate::types::UpdateVertexRequest) -> ::std::result::Result<
16165 crate::types::UpdateResponse,
16166 crate::errors::graph_storage_service::UpdateVertexError,
16167 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16168 >>,
16169 }
16170
16171 #[allow(clippy::redundant_closure)]
16172 impl<'mock> updateVertex<'mock> {
16173 pub fn unimplemented() -> Self {
16174 Self {
16175 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::UpdateVertexRequest| panic!(
16176 "{}::{} is not mocked",
16177 "GraphStorageService",
16178 "updateVertex",
16179 ))),
16180 }
16181 }
16182
16183 pub fn ret(&self, value: crate::types::UpdateResponse) {
16184 self.mock(move |_: crate::types::UpdateVertexRequest| value.clone());
16185 }
16186
16187 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::UpdateVertexRequest) -> crate::types::UpdateResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16188 let mut closure = self.closure.lock().unwrap();
16189 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16190 }
16191
16192 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::UpdateVertexRequest) -> ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateVertexError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16193 let mut closure = self.closure.lock().unwrap();
16194 *closure = ::std::boxed::Box::new(move |req| mock(req));
16195 }
16196
16197 pub fn throw<E>(&self, exception: E)
16198 where
16199 E: ::std::convert::Into<crate::errors::graph_storage_service::UpdateVertexError>,
16200 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16201 {
16202 let mut closure = self.closure.lock().unwrap();
16203 *closure = ::std::boxed::Box::new(move |_: crate::types::UpdateVertexRequest| ::std::result::Result::Err(exception.clone().into()));
16204 }
16205 }
16206
16207 pub struct updateEdge<'mock> {
16208 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16209 dyn ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> ::std::result::Result<
16210 crate::types::UpdateResponse,
16211 crate::errors::graph_storage_service::UpdateEdgeError,
16212 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16213 >>,
16214 }
16215
16216 #[allow(clippy::redundant_closure)]
16217 impl<'mock> updateEdge<'mock> {
16218 pub fn unimplemented() -> Self {
16219 Self {
16220 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::UpdateEdgeRequest| panic!(
16221 "{}::{} is not mocked",
16222 "GraphStorageService",
16223 "updateEdge",
16224 ))),
16225 }
16226 }
16227
16228 pub fn ret(&self, value: crate::types::UpdateResponse) {
16229 self.mock(move |_: crate::types::UpdateEdgeRequest| value.clone());
16230 }
16231
16232 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> crate::types::UpdateResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16233 let mut closure = self.closure.lock().unwrap();
16234 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16235 }
16236
16237 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::UpdateEdgeError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16238 let mut closure = self.closure.lock().unwrap();
16239 *closure = ::std::boxed::Box::new(move |req| mock(req));
16240 }
16241
16242 pub fn throw<E>(&self, exception: E)
16243 where
16244 E: ::std::convert::Into<crate::errors::graph_storage_service::UpdateEdgeError>,
16245 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16246 {
16247 let mut closure = self.closure.lock().unwrap();
16248 *closure = ::std::boxed::Box::new(move |_: crate::types::UpdateEdgeRequest| ::std::result::Result::Err(exception.clone().into()));
16249 }
16250 }
16251
16252 pub struct scanVertex<'mock> {
16253 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16254 dyn ::std::ops::FnMut(crate::types::ScanVertexRequest) -> ::std::result::Result<
16255 crate::types::ScanResponse,
16256 crate::errors::graph_storage_service::ScanVertexError,
16257 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16258 >>,
16259 }
16260
16261 #[allow(clippy::redundant_closure)]
16262 impl<'mock> scanVertex<'mock> {
16263 pub fn unimplemented() -> Self {
16264 Self {
16265 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::ScanVertexRequest| panic!(
16266 "{}::{} is not mocked",
16267 "GraphStorageService",
16268 "scanVertex",
16269 ))),
16270 }
16271 }
16272
16273 pub fn ret(&self, value: crate::types::ScanResponse) {
16274 self.mock(move |_: crate::types::ScanVertexRequest| value.clone());
16275 }
16276
16277 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::ScanVertexRequest) -> crate::types::ScanResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16278 let mut closure = self.closure.lock().unwrap();
16279 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16280 }
16281
16282 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::ScanVertexRequest) -> ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanVertexError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16283 let mut closure = self.closure.lock().unwrap();
16284 *closure = ::std::boxed::Box::new(move |req| mock(req));
16285 }
16286
16287 pub fn throw<E>(&self, exception: E)
16288 where
16289 E: ::std::convert::Into<crate::errors::graph_storage_service::ScanVertexError>,
16290 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16291 {
16292 let mut closure = self.closure.lock().unwrap();
16293 *closure = ::std::boxed::Box::new(move |_: crate::types::ScanVertexRequest| ::std::result::Result::Err(exception.clone().into()));
16294 }
16295 }
16296
16297 pub struct scanEdge<'mock> {
16298 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16299 dyn ::std::ops::FnMut(crate::types::ScanEdgeRequest) -> ::std::result::Result<
16300 crate::types::ScanResponse,
16301 crate::errors::graph_storage_service::ScanEdgeError,
16302 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16303 >>,
16304 }
16305
16306 #[allow(clippy::redundant_closure)]
16307 impl<'mock> scanEdge<'mock> {
16308 pub fn unimplemented() -> Self {
16309 Self {
16310 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::ScanEdgeRequest| panic!(
16311 "{}::{} is not mocked",
16312 "GraphStorageService",
16313 "scanEdge",
16314 ))),
16315 }
16316 }
16317
16318 pub fn ret(&self, value: crate::types::ScanResponse) {
16319 self.mock(move |_: crate::types::ScanEdgeRequest| value.clone());
16320 }
16321
16322 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::ScanEdgeRequest) -> crate::types::ScanResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16323 let mut closure = self.closure.lock().unwrap();
16324 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16325 }
16326
16327 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::ScanEdgeRequest) -> ::std::result::Result<crate::types::ScanResponse, crate::errors::graph_storage_service::ScanEdgeError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16328 let mut closure = self.closure.lock().unwrap();
16329 *closure = ::std::boxed::Box::new(move |req| mock(req));
16330 }
16331
16332 pub fn throw<E>(&self, exception: E)
16333 where
16334 E: ::std::convert::Into<crate::errors::graph_storage_service::ScanEdgeError>,
16335 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16336 {
16337 let mut closure = self.closure.lock().unwrap();
16338 *closure = ::std::boxed::Box::new(move |_: crate::types::ScanEdgeRequest| ::std::result::Result::Err(exception.clone().into()));
16339 }
16340 }
16341
16342 pub struct getUUID<'mock> {
16343 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16344 dyn ::std::ops::FnMut(crate::types::GetUUIDReq) -> ::std::result::Result<
16345 crate::types::GetUUIDResp,
16346 crate::errors::graph_storage_service::GetUUIDError,
16347 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16348 >>,
16349 }
16350
16351 #[allow(clippy::redundant_closure)]
16352 impl<'mock> getUUID<'mock> {
16353 pub fn unimplemented() -> Self {
16354 Self {
16355 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::GetUUIDReq| panic!(
16356 "{}::{} is not mocked",
16357 "GraphStorageService",
16358 "getUUID",
16359 ))),
16360 }
16361 }
16362
16363 pub fn ret(&self, value: crate::types::GetUUIDResp) {
16364 self.mock(move |_: crate::types::GetUUIDReq| value.clone());
16365 }
16366
16367 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetUUIDReq) -> crate::types::GetUUIDResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16368 let mut closure = self.closure.lock().unwrap();
16369 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16370 }
16371
16372 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetUUIDReq) -> ::std::result::Result<crate::types::GetUUIDResp, crate::errors::graph_storage_service::GetUUIDError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16373 let mut closure = self.closure.lock().unwrap();
16374 *closure = ::std::boxed::Box::new(move |req| mock(req));
16375 }
16376
16377 pub fn throw<E>(&self, exception: E)
16378 where
16379 E: ::std::convert::Into<crate::errors::graph_storage_service::GetUUIDError>,
16380 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16381 {
16382 let mut closure = self.closure.lock().unwrap();
16383 *closure = ::std::boxed::Box::new(move |_: crate::types::GetUUIDReq| ::std::result::Result::Err(exception.clone().into()));
16384 }
16385 }
16386
16387 pub struct lookupIndex<'mock> {
16388 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16389 dyn ::std::ops::FnMut(crate::types::LookupIndexRequest) -> ::std::result::Result<
16390 crate::types::LookupIndexResp,
16391 crate::errors::graph_storage_service::LookupIndexError,
16392 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16393 >>,
16394 }
16395
16396 #[allow(clippy::redundant_closure)]
16397 impl<'mock> lookupIndex<'mock> {
16398 pub fn unimplemented() -> Self {
16399 Self {
16400 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::LookupIndexRequest| panic!(
16401 "{}::{} is not mocked",
16402 "GraphStorageService",
16403 "lookupIndex",
16404 ))),
16405 }
16406 }
16407
16408 pub fn ret(&self, value: crate::types::LookupIndexResp) {
16409 self.mock(move |_: crate::types::LookupIndexRequest| value.clone());
16410 }
16411
16412 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::LookupIndexRequest) -> crate::types::LookupIndexResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16413 let mut closure = self.closure.lock().unwrap();
16414 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16415 }
16416
16417 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::LookupIndexRequest) -> ::std::result::Result<crate::types::LookupIndexResp, crate::errors::graph_storage_service::LookupIndexError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16418 let mut closure = self.closure.lock().unwrap();
16419 *closure = ::std::boxed::Box::new(move |req| mock(req));
16420 }
16421
16422 pub fn throw<E>(&self, exception: E)
16423 where
16424 E: ::std::convert::Into<crate::errors::graph_storage_service::LookupIndexError>,
16425 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16426 {
16427 let mut closure = self.closure.lock().unwrap();
16428 *closure = ::std::boxed::Box::new(move |_: crate::types::LookupIndexRequest| ::std::result::Result::Err(exception.clone().into()));
16429 }
16430 }
16431
16432 pub struct lookupAndTraverse<'mock> {
16433 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16434 dyn ::std::ops::FnMut(crate::types::LookupAndTraverseRequest) -> ::std::result::Result<
16435 crate::types::GetNeighborsResponse,
16436 crate::errors::graph_storage_service::LookupAndTraverseError,
16437 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16438 >>,
16439 }
16440
16441 #[allow(clippy::redundant_closure)]
16442 impl<'mock> lookupAndTraverse<'mock> {
16443 pub fn unimplemented() -> Self {
16444 Self {
16445 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::LookupAndTraverseRequest| panic!(
16446 "{}::{} is not mocked",
16447 "GraphStorageService",
16448 "lookupAndTraverse",
16449 ))),
16450 }
16451 }
16452
16453 pub fn ret(&self, value: crate::types::GetNeighborsResponse) {
16454 self.mock(move |_: crate::types::LookupAndTraverseRequest| value.clone());
16455 }
16456
16457 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::LookupAndTraverseRequest) -> crate::types::GetNeighborsResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16458 let mut closure = self.closure.lock().unwrap();
16459 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16460 }
16461
16462 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::LookupAndTraverseRequest) -> ::std::result::Result<crate::types::GetNeighborsResponse, crate::errors::graph_storage_service::LookupAndTraverseError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16463 let mut closure = self.closure.lock().unwrap();
16464 *closure = ::std::boxed::Box::new(move |req| mock(req));
16465 }
16466
16467 pub fn throw<E>(&self, exception: E)
16468 where
16469 E: ::std::convert::Into<crate::errors::graph_storage_service::LookupAndTraverseError>,
16470 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16471 {
16472 let mut closure = self.closure.lock().unwrap();
16473 *closure = ::std::boxed::Box::new(move |_: crate::types::LookupAndTraverseRequest| ::std::result::Result::Err(exception.clone().into()));
16474 }
16475 }
16476
16477 pub struct chainUpdateEdge<'mock> {
16478 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16479 dyn ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> ::std::result::Result<
16480 crate::types::UpdateResponse,
16481 crate::errors::graph_storage_service::ChainUpdateEdgeError,
16482 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16483 >>,
16484 }
16485
16486 #[allow(clippy::redundant_closure)]
16487 impl<'mock> chainUpdateEdge<'mock> {
16488 pub fn unimplemented() -> Self {
16489 Self {
16490 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::UpdateEdgeRequest| panic!(
16491 "{}::{} is not mocked",
16492 "GraphStorageService",
16493 "chainUpdateEdge",
16494 ))),
16495 }
16496 }
16497
16498 pub fn ret(&self, value: crate::types::UpdateResponse) {
16499 self.mock(move |_: crate::types::UpdateEdgeRequest| value.clone());
16500 }
16501
16502 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> crate::types::UpdateResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16503 let mut closure = self.closure.lock().unwrap();
16504 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16505 }
16506
16507 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::UpdateEdgeRequest) -> ::std::result::Result<crate::types::UpdateResponse, crate::errors::graph_storage_service::ChainUpdateEdgeError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16508 let mut closure = self.closure.lock().unwrap();
16509 *closure = ::std::boxed::Box::new(move |req| mock(req));
16510 }
16511
16512 pub fn throw<E>(&self, exception: E)
16513 where
16514 E: ::std::convert::Into<crate::errors::graph_storage_service::ChainUpdateEdgeError>,
16515 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16516 {
16517 let mut closure = self.closure.lock().unwrap();
16518 *closure = ::std::boxed::Box::new(move |_: crate::types::UpdateEdgeRequest| ::std::result::Result::Err(exception.clone().into()));
16519 }
16520 }
16521
16522 pub struct chainAddEdges<'mock> {
16523 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16524 dyn ::std::ops::FnMut(crate::types::AddEdgesRequest) -> ::std::result::Result<
16525 crate::types::ExecResponse,
16526 crate::errors::graph_storage_service::ChainAddEdgesError,
16527 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16528 >>,
16529 }
16530
16531 #[allow(clippy::redundant_closure)]
16532 impl<'mock> chainAddEdges<'mock> {
16533 pub fn unimplemented() -> Self {
16534 Self {
16535 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::AddEdgesRequest| panic!(
16536 "{}::{} is not mocked",
16537 "GraphStorageService",
16538 "chainAddEdges",
16539 ))),
16540 }
16541 }
16542
16543 pub fn ret(&self, value: crate::types::ExecResponse) {
16544 self.mock(move |_: crate::types::AddEdgesRequest| value.clone());
16545 }
16546
16547 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddEdgesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16548 let mut closure = self.closure.lock().unwrap();
16549 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16550 }
16551
16552 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddEdgesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainAddEdgesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16553 let mut closure = self.closure.lock().unwrap();
16554 *closure = ::std::boxed::Box::new(move |req| mock(req));
16555 }
16556
16557 pub fn throw<E>(&self, exception: E)
16558 where
16559 E: ::std::convert::Into<crate::errors::graph_storage_service::ChainAddEdgesError>,
16560 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16561 {
16562 let mut closure = self.closure.lock().unwrap();
16563 *closure = ::std::boxed::Box::new(move |_: crate::types::AddEdgesRequest| ::std::result::Result::Err(exception.clone().into()));
16564 }
16565 }
16566
16567 pub struct chainDeleteEdges<'mock> {
16568 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16569 dyn ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> ::std::result::Result<
16570 crate::types::ExecResponse,
16571 crate::errors::graph_storage_service::ChainDeleteEdgesError,
16572 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16573 >>,
16574 }
16575
16576 #[allow(clippy::redundant_closure)]
16577 impl<'mock> chainDeleteEdges<'mock> {
16578 pub fn unimplemented() -> Self {
16579 Self {
16580 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::DeleteEdgesRequest| panic!(
16581 "{}::{} is not mocked",
16582 "GraphStorageService",
16583 "chainDeleteEdges",
16584 ))),
16585 }
16586 }
16587
16588 pub fn ret(&self, value: crate::types::ExecResponse) {
16589 self.mock(move |_: crate::types::DeleteEdgesRequest| value.clone());
16590 }
16591
16592 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16593 let mut closure = self.closure.lock().unwrap();
16594 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16595 }
16596
16597 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::DeleteEdgesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::ChainDeleteEdgesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16598 let mut closure = self.closure.lock().unwrap();
16599 *closure = ::std::boxed::Box::new(move |req| mock(req));
16600 }
16601
16602 pub fn throw<E>(&self, exception: E)
16603 where
16604 E: ::std::convert::Into<crate::errors::graph_storage_service::ChainDeleteEdgesError>,
16605 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16606 {
16607 let mut closure = self.closure.lock().unwrap();
16608 *closure = ::std::boxed::Box::new(move |_: crate::types::DeleteEdgesRequest| ::std::result::Result::Err(exception.clone().into()));
16609 }
16610 }
16611
16612 pub struct get<'mock> {
16613 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16614 dyn ::std::ops::FnMut(crate::types::KVGetRequest) -> ::std::result::Result<
16615 crate::types::KVGetResponse,
16616 crate::errors::graph_storage_service::GetError,
16617 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16618 >>,
16619 }
16620
16621 #[allow(clippy::redundant_closure)]
16622 impl<'mock> get<'mock> {
16623 pub fn unimplemented() -> Self {
16624 Self {
16625 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::KVGetRequest| panic!(
16626 "{}::{} is not mocked",
16627 "GraphStorageService",
16628 "get",
16629 ))),
16630 }
16631 }
16632
16633 pub fn ret(&self, value: crate::types::KVGetResponse) {
16634 self.mock(move |_: crate::types::KVGetRequest| value.clone());
16635 }
16636
16637 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::KVGetRequest) -> crate::types::KVGetResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16638 let mut closure = self.closure.lock().unwrap();
16639 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16640 }
16641
16642 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::KVGetRequest) -> ::std::result::Result<crate::types::KVGetResponse, crate::errors::graph_storage_service::GetError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16643 let mut closure = self.closure.lock().unwrap();
16644 *closure = ::std::boxed::Box::new(move |req| mock(req));
16645 }
16646
16647 pub fn throw<E>(&self, exception: E)
16648 where
16649 E: ::std::convert::Into<crate::errors::graph_storage_service::GetError>,
16650 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16651 {
16652 let mut closure = self.closure.lock().unwrap();
16653 *closure = ::std::boxed::Box::new(move |_: crate::types::KVGetRequest| ::std::result::Result::Err(exception.clone().into()));
16654 }
16655 }
16656
16657 pub struct put<'mock> {
16658 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16659 dyn ::std::ops::FnMut(crate::types::KVPutRequest) -> ::std::result::Result<
16660 crate::types::ExecResponse,
16661 crate::errors::graph_storage_service::PutError,
16662 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16663 >>,
16664 }
16665
16666 #[allow(clippy::redundant_closure)]
16667 impl<'mock> put<'mock> {
16668 pub fn unimplemented() -> Self {
16669 Self {
16670 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::KVPutRequest| panic!(
16671 "{}::{} is not mocked",
16672 "GraphStorageService",
16673 "put",
16674 ))),
16675 }
16676 }
16677
16678 pub fn ret(&self, value: crate::types::ExecResponse) {
16679 self.mock(move |_: crate::types::KVPutRequest| value.clone());
16680 }
16681
16682 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::KVPutRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16683 let mut closure = self.closure.lock().unwrap();
16684 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16685 }
16686
16687 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::KVPutRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::PutError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16688 let mut closure = self.closure.lock().unwrap();
16689 *closure = ::std::boxed::Box::new(move |req| mock(req));
16690 }
16691
16692 pub fn throw<E>(&self, exception: E)
16693 where
16694 E: ::std::convert::Into<crate::errors::graph_storage_service::PutError>,
16695 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16696 {
16697 let mut closure = self.closure.lock().unwrap();
16698 *closure = ::std::boxed::Box::new(move |_: crate::types::KVPutRequest| ::std::result::Result::Err(exception.clone().into()));
16699 }
16700 }
16701
16702 pub struct remove<'mock> {
16703 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16704 dyn ::std::ops::FnMut(crate::types::KVRemoveRequest) -> ::std::result::Result<
16705 crate::types::ExecResponse,
16706 crate::errors::graph_storage_service::RemoveError,
16707 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16708 >>,
16709 }
16710
16711 #[allow(clippy::redundant_closure)]
16712 impl<'mock> remove<'mock> {
16713 pub fn unimplemented() -> Self {
16714 Self {
16715 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::KVRemoveRequest| panic!(
16716 "{}::{} is not mocked",
16717 "GraphStorageService",
16718 "remove",
16719 ))),
16720 }
16721 }
16722
16723 pub fn ret(&self, value: crate::types::ExecResponse) {
16724 self.mock(move |_: crate::types::KVRemoveRequest| value.clone());
16725 }
16726
16727 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::KVRemoveRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16728 let mut closure = self.closure.lock().unwrap();
16729 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16730 }
16731
16732 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::KVRemoveRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::graph_storage_service::RemoveError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16733 let mut closure = self.closure.lock().unwrap();
16734 *closure = ::std::boxed::Box::new(move |req| mock(req));
16735 }
16736
16737 pub fn throw<E>(&self, exception: E)
16738 where
16739 E: ::std::convert::Into<crate::errors::graph_storage_service::RemoveError>,
16740 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16741 {
16742 let mut closure = self.closure.lock().unwrap();
16743 *closure = ::std::boxed::Box::new(move |_: crate::types::KVRemoveRequest| ::std::result::Result::Err(exception.clone().into()));
16744 }
16745 }
16746 }
16747 pub mod storage_admin_service {
16748
16749 pub struct transLeader<'mock> {
16750 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16751 dyn ::std::ops::FnMut(crate::types::TransLeaderReq) -> ::std::result::Result<
16752 crate::types::AdminExecResp,
16753 crate::errors::storage_admin_service::TransLeaderError,
16754 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16755 >>,
16756 }
16757
16758 #[allow(clippy::redundant_closure)]
16759 impl<'mock> transLeader<'mock> {
16760 pub fn unimplemented() -> Self {
16761 Self {
16762 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::TransLeaderReq| panic!(
16763 "{}::{} is not mocked",
16764 "StorageAdminService",
16765 "transLeader",
16766 ))),
16767 }
16768 }
16769
16770 pub fn ret(&self, value: crate::types::AdminExecResp) {
16771 self.mock(move |_: crate::types::TransLeaderReq| value.clone());
16772 }
16773
16774 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::TransLeaderReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16775 let mut closure = self.closure.lock().unwrap();
16776 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16777 }
16778
16779 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::TransLeaderReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::TransLeaderError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16780 let mut closure = self.closure.lock().unwrap();
16781 *closure = ::std::boxed::Box::new(move |req| mock(req));
16782 }
16783
16784 pub fn throw<E>(&self, exception: E)
16785 where
16786 E: ::std::convert::Into<crate::errors::storage_admin_service::TransLeaderError>,
16787 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16788 {
16789 let mut closure = self.closure.lock().unwrap();
16790 *closure = ::std::boxed::Box::new(move |_: crate::types::TransLeaderReq| ::std::result::Result::Err(exception.clone().into()));
16791 }
16792 }
16793
16794 pub struct addPart<'mock> {
16795 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16796 dyn ::std::ops::FnMut(crate::types::AddPartReq) -> ::std::result::Result<
16797 crate::types::AdminExecResp,
16798 crate::errors::storage_admin_service::AddPartError,
16799 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16800 >>,
16801 }
16802
16803 #[allow(clippy::redundant_closure)]
16804 impl<'mock> addPart<'mock> {
16805 pub fn unimplemented() -> Self {
16806 Self {
16807 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::AddPartReq| panic!(
16808 "{}::{} is not mocked",
16809 "StorageAdminService",
16810 "addPart",
16811 ))),
16812 }
16813 }
16814
16815 pub fn ret(&self, value: crate::types::AdminExecResp) {
16816 self.mock(move |_: crate::types::AddPartReq| value.clone());
16817 }
16818
16819 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddPartReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16820 let mut closure = self.closure.lock().unwrap();
16821 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16822 }
16823
16824 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddPartReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddPartError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16825 let mut closure = self.closure.lock().unwrap();
16826 *closure = ::std::boxed::Box::new(move |req| mock(req));
16827 }
16828
16829 pub fn throw<E>(&self, exception: E)
16830 where
16831 E: ::std::convert::Into<crate::errors::storage_admin_service::AddPartError>,
16832 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16833 {
16834 let mut closure = self.closure.lock().unwrap();
16835 *closure = ::std::boxed::Box::new(move |_: crate::types::AddPartReq| ::std::result::Result::Err(exception.clone().into()));
16836 }
16837 }
16838
16839 pub struct addLearner<'mock> {
16840 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16841 dyn ::std::ops::FnMut(crate::types::AddLearnerReq) -> ::std::result::Result<
16842 crate::types::AdminExecResp,
16843 crate::errors::storage_admin_service::AddLearnerError,
16844 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16845 >>,
16846 }
16847
16848 #[allow(clippy::redundant_closure)]
16849 impl<'mock> addLearner<'mock> {
16850 pub fn unimplemented() -> Self {
16851 Self {
16852 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::AddLearnerReq| panic!(
16853 "{}::{} is not mocked",
16854 "StorageAdminService",
16855 "addLearner",
16856 ))),
16857 }
16858 }
16859
16860 pub fn ret(&self, value: crate::types::AdminExecResp) {
16861 self.mock(move |_: crate::types::AddLearnerReq| value.clone());
16862 }
16863
16864 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddLearnerReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16865 let mut closure = self.closure.lock().unwrap();
16866 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16867 }
16868
16869 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddLearnerReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::AddLearnerError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16870 let mut closure = self.closure.lock().unwrap();
16871 *closure = ::std::boxed::Box::new(move |req| mock(req));
16872 }
16873
16874 pub fn throw<E>(&self, exception: E)
16875 where
16876 E: ::std::convert::Into<crate::errors::storage_admin_service::AddLearnerError>,
16877 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16878 {
16879 let mut closure = self.closure.lock().unwrap();
16880 *closure = ::std::boxed::Box::new(move |_: crate::types::AddLearnerReq| ::std::result::Result::Err(exception.clone().into()));
16881 }
16882 }
16883
16884 pub struct removePart<'mock> {
16885 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16886 dyn ::std::ops::FnMut(crate::types::RemovePartReq) -> ::std::result::Result<
16887 crate::types::AdminExecResp,
16888 crate::errors::storage_admin_service::RemovePartError,
16889 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16890 >>,
16891 }
16892
16893 #[allow(clippy::redundant_closure)]
16894 impl<'mock> removePart<'mock> {
16895 pub fn unimplemented() -> Self {
16896 Self {
16897 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::RemovePartReq| panic!(
16898 "{}::{} is not mocked",
16899 "StorageAdminService",
16900 "removePart",
16901 ))),
16902 }
16903 }
16904
16905 pub fn ret(&self, value: crate::types::AdminExecResp) {
16906 self.mock(move |_: crate::types::RemovePartReq| value.clone());
16907 }
16908
16909 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::RemovePartReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16910 let mut closure = self.closure.lock().unwrap();
16911 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16912 }
16913
16914 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::RemovePartReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::RemovePartError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16915 let mut closure = self.closure.lock().unwrap();
16916 *closure = ::std::boxed::Box::new(move |req| mock(req));
16917 }
16918
16919 pub fn throw<E>(&self, exception: E)
16920 where
16921 E: ::std::convert::Into<crate::errors::storage_admin_service::RemovePartError>,
16922 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16923 {
16924 let mut closure = self.closure.lock().unwrap();
16925 *closure = ::std::boxed::Box::new(move |_: crate::types::RemovePartReq| ::std::result::Result::Err(exception.clone().into()));
16926 }
16927 }
16928
16929 pub struct memberChange<'mock> {
16930 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16931 dyn ::std::ops::FnMut(crate::types::MemberChangeReq) -> ::std::result::Result<
16932 crate::types::AdminExecResp,
16933 crate::errors::storage_admin_service::MemberChangeError,
16934 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16935 >>,
16936 }
16937
16938 #[allow(clippy::redundant_closure)]
16939 impl<'mock> memberChange<'mock> {
16940 pub fn unimplemented() -> Self {
16941 Self {
16942 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::MemberChangeReq| panic!(
16943 "{}::{} is not mocked",
16944 "StorageAdminService",
16945 "memberChange",
16946 ))),
16947 }
16948 }
16949
16950 pub fn ret(&self, value: crate::types::AdminExecResp) {
16951 self.mock(move |_: crate::types::MemberChangeReq| value.clone());
16952 }
16953
16954 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::MemberChangeReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16955 let mut closure = self.closure.lock().unwrap();
16956 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
16957 }
16958
16959 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::MemberChangeReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::MemberChangeError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
16960 let mut closure = self.closure.lock().unwrap();
16961 *closure = ::std::boxed::Box::new(move |req| mock(req));
16962 }
16963
16964 pub fn throw<E>(&self, exception: E)
16965 where
16966 E: ::std::convert::Into<crate::errors::storage_admin_service::MemberChangeError>,
16967 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
16968 {
16969 let mut closure = self.closure.lock().unwrap();
16970 *closure = ::std::boxed::Box::new(move |_: crate::types::MemberChangeReq| ::std::result::Result::Err(exception.clone().into()));
16971 }
16972 }
16973
16974 pub struct waitingForCatchUpData<'mock> {
16975 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
16976 dyn ::std::ops::FnMut(crate::types::CatchUpDataReq) -> ::std::result::Result<
16977 crate::types::AdminExecResp,
16978 crate::errors::storage_admin_service::WaitingForCatchUpDataError,
16979 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
16980 >>,
16981 }
16982
16983 #[allow(clippy::redundant_closure)]
16984 impl<'mock> waitingForCatchUpData<'mock> {
16985 pub fn unimplemented() -> Self {
16986 Self {
16987 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::CatchUpDataReq| panic!(
16988 "{}::{} is not mocked",
16989 "StorageAdminService",
16990 "waitingForCatchUpData",
16991 ))),
16992 }
16993 }
16994
16995 pub fn ret(&self, value: crate::types::AdminExecResp) {
16996 self.mock(move |_: crate::types::CatchUpDataReq| value.clone());
16997 }
16998
16999 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::CatchUpDataReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17000 let mut closure = self.closure.lock().unwrap();
17001 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17002 }
17003
17004 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::CatchUpDataReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::WaitingForCatchUpDataError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17005 let mut closure = self.closure.lock().unwrap();
17006 *closure = ::std::boxed::Box::new(move |req| mock(req));
17007 }
17008
17009 pub fn throw<E>(&self, exception: E)
17010 where
17011 E: ::std::convert::Into<crate::errors::storage_admin_service::WaitingForCatchUpDataError>,
17012 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17013 {
17014 let mut closure = self.closure.lock().unwrap();
17015 *closure = ::std::boxed::Box::new(move |_: crate::types::CatchUpDataReq| ::std::result::Result::Err(exception.clone().into()));
17016 }
17017 }
17018
17019 pub struct createCheckpoint<'mock> {
17020 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17021 dyn ::std::ops::FnMut(crate::types::CreateCPRequest) -> ::std::result::Result<
17022 crate::types::CreateCPResp,
17023 crate::errors::storage_admin_service::CreateCheckpointError,
17024 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17025 >>,
17026 }
17027
17028 #[allow(clippy::redundant_closure)]
17029 impl<'mock> createCheckpoint<'mock> {
17030 pub fn unimplemented() -> Self {
17031 Self {
17032 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::CreateCPRequest| panic!(
17033 "{}::{} is not mocked",
17034 "StorageAdminService",
17035 "createCheckpoint",
17036 ))),
17037 }
17038 }
17039
17040 pub fn ret(&self, value: crate::types::CreateCPResp) {
17041 self.mock(move |_: crate::types::CreateCPRequest| value.clone());
17042 }
17043
17044 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::CreateCPRequest) -> crate::types::CreateCPResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17045 let mut closure = self.closure.lock().unwrap();
17046 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17047 }
17048
17049 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::CreateCPRequest) -> ::std::result::Result<crate::types::CreateCPResp, crate::errors::storage_admin_service::CreateCheckpointError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17050 let mut closure = self.closure.lock().unwrap();
17051 *closure = ::std::boxed::Box::new(move |req| mock(req));
17052 }
17053
17054 pub fn throw<E>(&self, exception: E)
17055 where
17056 E: ::std::convert::Into<crate::errors::storage_admin_service::CreateCheckpointError>,
17057 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17058 {
17059 let mut closure = self.closure.lock().unwrap();
17060 *closure = ::std::boxed::Box::new(move |_: crate::types::CreateCPRequest| ::std::result::Result::Err(exception.clone().into()));
17061 }
17062 }
17063
17064 pub struct dropCheckpoint<'mock> {
17065 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17066 dyn ::std::ops::FnMut(crate::types::DropCPRequest) -> ::std::result::Result<
17067 crate::types::DropCPResp,
17068 crate::errors::storage_admin_service::DropCheckpointError,
17069 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17070 >>,
17071 }
17072
17073 #[allow(clippy::redundant_closure)]
17074 impl<'mock> dropCheckpoint<'mock> {
17075 pub fn unimplemented() -> Self {
17076 Self {
17077 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::DropCPRequest| panic!(
17078 "{}::{} is not mocked",
17079 "StorageAdminService",
17080 "dropCheckpoint",
17081 ))),
17082 }
17083 }
17084
17085 pub fn ret(&self, value: crate::types::DropCPResp) {
17086 self.mock(move |_: crate::types::DropCPRequest| value.clone());
17087 }
17088
17089 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::DropCPRequest) -> crate::types::DropCPResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17090 let mut closure = self.closure.lock().unwrap();
17091 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17092 }
17093
17094 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::DropCPRequest) -> ::std::result::Result<crate::types::DropCPResp, crate::errors::storage_admin_service::DropCheckpointError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17095 let mut closure = self.closure.lock().unwrap();
17096 *closure = ::std::boxed::Box::new(move |req| mock(req));
17097 }
17098
17099 pub fn throw<E>(&self, exception: E)
17100 where
17101 E: ::std::convert::Into<crate::errors::storage_admin_service::DropCheckpointError>,
17102 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17103 {
17104 let mut closure = self.closure.lock().unwrap();
17105 *closure = ::std::boxed::Box::new(move |_: crate::types::DropCPRequest| ::std::result::Result::Err(exception.clone().into()));
17106 }
17107 }
17108
17109 pub struct blockingWrites<'mock> {
17110 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17111 dyn ::std::ops::FnMut(crate::types::BlockingSignRequest) -> ::std::result::Result<
17112 crate::types::BlockingSignResp,
17113 crate::errors::storage_admin_service::BlockingWritesError,
17114 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17115 >>,
17116 }
17117
17118 #[allow(clippy::redundant_closure)]
17119 impl<'mock> blockingWrites<'mock> {
17120 pub fn unimplemented() -> Self {
17121 Self {
17122 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::BlockingSignRequest| panic!(
17123 "{}::{} is not mocked",
17124 "StorageAdminService",
17125 "blockingWrites",
17126 ))),
17127 }
17128 }
17129
17130 pub fn ret(&self, value: crate::types::BlockingSignResp) {
17131 self.mock(move |_: crate::types::BlockingSignRequest| value.clone());
17132 }
17133
17134 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::BlockingSignRequest) -> crate::types::BlockingSignResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17135 let mut closure = self.closure.lock().unwrap();
17136 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17137 }
17138
17139 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::BlockingSignRequest) -> ::std::result::Result<crate::types::BlockingSignResp, crate::errors::storage_admin_service::BlockingWritesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17140 let mut closure = self.closure.lock().unwrap();
17141 *closure = ::std::boxed::Box::new(move |req| mock(req));
17142 }
17143
17144 pub fn throw<E>(&self, exception: E)
17145 where
17146 E: ::std::convert::Into<crate::errors::storage_admin_service::BlockingWritesError>,
17147 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17148 {
17149 let mut closure = self.closure.lock().unwrap();
17150 *closure = ::std::boxed::Box::new(move |_: crate::types::BlockingSignRequest| ::std::result::Result::Err(exception.clone().into()));
17151 }
17152 }
17153
17154 pub struct getLeaderParts<'mock> {
17155 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17156 dyn ::std::ops::FnMut(crate::types::GetLeaderReq) -> ::std::result::Result<
17157 crate::types::GetLeaderPartsResp,
17158 crate::errors::storage_admin_service::GetLeaderPartsError,
17159 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17160 >>,
17161 }
17162
17163 #[allow(clippy::redundant_closure)]
17164 impl<'mock> getLeaderParts<'mock> {
17165 pub fn unimplemented() -> Self {
17166 Self {
17167 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::GetLeaderReq| panic!(
17168 "{}::{} is not mocked",
17169 "StorageAdminService",
17170 "getLeaderParts",
17171 ))),
17172 }
17173 }
17174
17175 pub fn ret(&self, value: crate::types::GetLeaderPartsResp) {
17176 self.mock(move |_: crate::types::GetLeaderReq| value.clone());
17177 }
17178
17179 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetLeaderReq) -> crate::types::GetLeaderPartsResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17180 let mut closure = self.closure.lock().unwrap();
17181 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17182 }
17183
17184 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::GetLeaderReq) -> ::std::result::Result<crate::types::GetLeaderPartsResp, crate::errors::storage_admin_service::GetLeaderPartsError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17185 let mut closure = self.closure.lock().unwrap();
17186 *closure = ::std::boxed::Box::new(move |req| mock(req));
17187 }
17188
17189 pub fn throw<E>(&self, exception: E)
17190 where
17191 E: ::std::convert::Into<crate::errors::storage_admin_service::GetLeaderPartsError>,
17192 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17193 {
17194 let mut closure = self.closure.lock().unwrap();
17195 *closure = ::std::boxed::Box::new(move |_: crate::types::GetLeaderReq| ::std::result::Result::Err(exception.clone().into()));
17196 }
17197 }
17198
17199 pub struct checkPeers<'mock> {
17200 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17201 dyn ::std::ops::FnMut(crate::types::CheckPeersReq) -> ::std::result::Result<
17202 crate::types::AdminExecResp,
17203 crate::errors::storage_admin_service::CheckPeersError,
17204 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17205 >>,
17206 }
17207
17208 #[allow(clippy::redundant_closure)]
17209 impl<'mock> checkPeers<'mock> {
17210 pub fn unimplemented() -> Self {
17211 Self {
17212 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::CheckPeersReq| panic!(
17213 "{}::{} is not mocked",
17214 "StorageAdminService",
17215 "checkPeers",
17216 ))),
17217 }
17218 }
17219
17220 pub fn ret(&self, value: crate::types::AdminExecResp) {
17221 self.mock(move |_: crate::types::CheckPeersReq| value.clone());
17222 }
17223
17224 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::CheckPeersReq) -> crate::types::AdminExecResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17225 let mut closure = self.closure.lock().unwrap();
17226 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17227 }
17228
17229 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::CheckPeersReq) -> ::std::result::Result<crate::types::AdminExecResp, crate::errors::storage_admin_service::CheckPeersError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17230 let mut closure = self.closure.lock().unwrap();
17231 *closure = ::std::boxed::Box::new(move |req| mock(req));
17232 }
17233
17234 pub fn throw<E>(&self, exception: E)
17235 where
17236 E: ::std::convert::Into<crate::errors::storage_admin_service::CheckPeersError>,
17237 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17238 {
17239 let mut closure = self.closure.lock().unwrap();
17240 *closure = ::std::boxed::Box::new(move |_: crate::types::CheckPeersReq| ::std::result::Result::Err(exception.clone().into()));
17241 }
17242 }
17243
17244 pub struct addAdminTask<'mock> {
17245 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17246 dyn ::std::ops::FnMut(crate::types::AddTaskRequest) -> ::std::result::Result<
17247 crate::types::AddTaskResp,
17248 crate::errors::storage_admin_service::AddAdminTaskError,
17249 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17250 >>,
17251 }
17252
17253 #[allow(clippy::redundant_closure)]
17254 impl<'mock> addAdminTask<'mock> {
17255 pub fn unimplemented() -> Self {
17256 Self {
17257 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::AddTaskRequest| panic!(
17258 "{}::{} is not mocked",
17259 "StorageAdminService",
17260 "addAdminTask",
17261 ))),
17262 }
17263 }
17264
17265 pub fn ret(&self, value: crate::types::AddTaskResp) {
17266 self.mock(move |_: crate::types::AddTaskRequest| value.clone());
17267 }
17268
17269 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddTaskRequest) -> crate::types::AddTaskResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17270 let mut closure = self.closure.lock().unwrap();
17271 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17272 }
17273
17274 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::AddTaskRequest) -> ::std::result::Result<crate::types::AddTaskResp, crate::errors::storage_admin_service::AddAdminTaskError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17275 let mut closure = self.closure.lock().unwrap();
17276 *closure = ::std::boxed::Box::new(move |req| mock(req));
17277 }
17278
17279 pub fn throw<E>(&self, exception: E)
17280 where
17281 E: ::std::convert::Into<crate::errors::storage_admin_service::AddAdminTaskError>,
17282 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17283 {
17284 let mut closure = self.closure.lock().unwrap();
17285 *closure = ::std::boxed::Box::new(move |_: crate::types::AddTaskRequest| ::std::result::Result::Err(exception.clone().into()));
17286 }
17287 }
17288
17289 pub struct stopAdminTask<'mock> {
17290 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17291 dyn ::std::ops::FnMut(crate::types::StopTaskRequest) -> ::std::result::Result<
17292 crate::types::StopTaskResp,
17293 crate::errors::storage_admin_service::StopAdminTaskError,
17294 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17295 >>,
17296 }
17297
17298 #[allow(clippy::redundant_closure)]
17299 impl<'mock> stopAdminTask<'mock> {
17300 pub fn unimplemented() -> Self {
17301 Self {
17302 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::StopTaskRequest| panic!(
17303 "{}::{} is not mocked",
17304 "StorageAdminService",
17305 "stopAdminTask",
17306 ))),
17307 }
17308 }
17309
17310 pub fn ret(&self, value: crate::types::StopTaskResp) {
17311 self.mock(move |_: crate::types::StopTaskRequest| value.clone());
17312 }
17313
17314 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::StopTaskRequest) -> crate::types::StopTaskResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17315 let mut closure = self.closure.lock().unwrap();
17316 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17317 }
17318
17319 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::StopTaskRequest) -> ::std::result::Result<crate::types::StopTaskResp, crate::errors::storage_admin_service::StopAdminTaskError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17320 let mut closure = self.closure.lock().unwrap();
17321 *closure = ::std::boxed::Box::new(move |req| mock(req));
17322 }
17323
17324 pub fn throw<E>(&self, exception: E)
17325 where
17326 E: ::std::convert::Into<crate::errors::storage_admin_service::StopAdminTaskError>,
17327 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17328 {
17329 let mut closure = self.closure.lock().unwrap();
17330 *closure = ::std::boxed::Box::new(move |_: crate::types::StopTaskRequest| ::std::result::Result::Err(exception.clone().into()));
17331 }
17332 }
17333
17334 pub struct clearSpace<'mock> {
17335 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17336 dyn ::std::ops::FnMut(crate::types::ClearSpaceReq) -> ::std::result::Result<
17337 crate::types::ClearSpaceResp,
17338 crate::errors::storage_admin_service::ClearSpaceError,
17339 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17340 >>,
17341 }
17342
17343 #[allow(clippy::redundant_closure)]
17344 impl<'mock> clearSpace<'mock> {
17345 pub fn unimplemented() -> Self {
17346 Self {
17347 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::ClearSpaceReq| panic!(
17348 "{}::{} is not mocked",
17349 "StorageAdminService",
17350 "clearSpace",
17351 ))),
17352 }
17353 }
17354
17355 pub fn ret(&self, value: crate::types::ClearSpaceResp) {
17356 self.mock(move |_: crate::types::ClearSpaceReq| value.clone());
17357 }
17358
17359 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::ClearSpaceReq) -> crate::types::ClearSpaceResp + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17360 let mut closure = self.closure.lock().unwrap();
17361 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17362 }
17363
17364 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::ClearSpaceReq) -> ::std::result::Result<crate::types::ClearSpaceResp, crate::errors::storage_admin_service::ClearSpaceError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17365 let mut closure = self.closure.lock().unwrap();
17366 *closure = ::std::boxed::Box::new(move |req| mock(req));
17367 }
17368
17369 pub fn throw<E>(&self, exception: E)
17370 where
17371 E: ::std::convert::Into<crate::errors::storage_admin_service::ClearSpaceError>,
17372 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17373 {
17374 let mut closure = self.closure.lock().unwrap();
17375 *closure = ::std::boxed::Box::new(move |_: crate::types::ClearSpaceReq| ::std::result::Result::Err(exception.clone().into()));
17376 }
17377 }
17378 }
17379 pub mod internal_storage_service {
17380
17381 pub struct chainAddEdges<'mock> {
17382 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17383 dyn ::std::ops::FnMut(crate::types::ChainAddEdgesRequest) -> ::std::result::Result<
17384 crate::types::ExecResponse,
17385 crate::errors::internal_storage_service::ChainAddEdgesError,
17386 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17387 >>,
17388 }
17389
17390 #[allow(clippy::redundant_closure)]
17391 impl<'mock> chainAddEdges<'mock> {
17392 pub fn unimplemented() -> Self {
17393 Self {
17394 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::ChainAddEdgesRequest| panic!(
17395 "{}::{} is not mocked",
17396 "InternalStorageService",
17397 "chainAddEdges",
17398 ))),
17399 }
17400 }
17401
17402 pub fn ret(&self, value: crate::types::ExecResponse) {
17403 self.mock(move |_: crate::types::ChainAddEdgesRequest| value.clone());
17404 }
17405
17406 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::ChainAddEdgesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17407 let mut closure = self.closure.lock().unwrap();
17408 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17409 }
17410
17411 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::ChainAddEdgesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainAddEdgesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17412 let mut closure = self.closure.lock().unwrap();
17413 *closure = ::std::boxed::Box::new(move |req| mock(req));
17414 }
17415
17416 pub fn throw<E>(&self, exception: E)
17417 where
17418 E: ::std::convert::Into<crate::errors::internal_storage_service::ChainAddEdgesError>,
17419 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17420 {
17421 let mut closure = self.closure.lock().unwrap();
17422 *closure = ::std::boxed::Box::new(move |_: crate::types::ChainAddEdgesRequest| ::std::result::Result::Err(exception.clone().into()));
17423 }
17424 }
17425
17426 pub struct chainUpdateEdge<'mock> {
17427 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17428 dyn ::std::ops::FnMut(crate::types::ChainUpdateEdgeRequest) -> ::std::result::Result<
17429 crate::types::UpdateResponse,
17430 crate::errors::internal_storage_service::ChainUpdateEdgeError,
17431 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17432 >>,
17433 }
17434
17435 #[allow(clippy::redundant_closure)]
17436 impl<'mock> chainUpdateEdge<'mock> {
17437 pub fn unimplemented() -> Self {
17438 Self {
17439 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::ChainUpdateEdgeRequest| panic!(
17440 "{}::{} is not mocked",
17441 "InternalStorageService",
17442 "chainUpdateEdge",
17443 ))),
17444 }
17445 }
17446
17447 pub fn ret(&self, value: crate::types::UpdateResponse) {
17448 self.mock(move |_: crate::types::ChainUpdateEdgeRequest| value.clone());
17449 }
17450
17451 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::ChainUpdateEdgeRequest) -> crate::types::UpdateResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17452 let mut closure = self.closure.lock().unwrap();
17453 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17454 }
17455
17456 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::ChainUpdateEdgeRequest) -> ::std::result::Result<crate::types::UpdateResponse, crate::errors::internal_storage_service::ChainUpdateEdgeError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17457 let mut closure = self.closure.lock().unwrap();
17458 *closure = ::std::boxed::Box::new(move |req| mock(req));
17459 }
17460
17461 pub fn throw<E>(&self, exception: E)
17462 where
17463 E: ::std::convert::Into<crate::errors::internal_storage_service::ChainUpdateEdgeError>,
17464 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17465 {
17466 let mut closure = self.closure.lock().unwrap();
17467 *closure = ::std::boxed::Box::new(move |_: crate::types::ChainUpdateEdgeRequest| ::std::result::Result::Err(exception.clone().into()));
17468 }
17469 }
17470
17471 pub struct chainDeleteEdges<'mock> {
17472 pub(crate) closure: ::std::sync::Mutex<::std::boxed::Box<
17473 dyn ::std::ops::FnMut(crate::types::ChainDeleteEdgesRequest) -> ::std::result::Result<
17474 crate::types::ExecResponse,
17475 crate::errors::internal_storage_service::ChainDeleteEdgesError,
17476 > + ::std::marker::Send + ::std::marker::Sync + 'mock,
17477 >>,
17478 }
17479
17480 #[allow(clippy::redundant_closure)]
17481 impl<'mock> chainDeleteEdges<'mock> {
17482 pub fn unimplemented() -> Self {
17483 Self {
17484 closure: ::std::sync::Mutex::new(::std::boxed::Box::new(|_: crate::types::ChainDeleteEdgesRequest| panic!(
17485 "{}::{} is not mocked",
17486 "InternalStorageService",
17487 "chainDeleteEdges",
17488 ))),
17489 }
17490 }
17491
17492 pub fn ret(&self, value: crate::types::ExecResponse) {
17493 self.mock(move |_: crate::types::ChainDeleteEdgesRequest| value.clone());
17494 }
17495
17496 pub fn mock(&self, mut mock: impl ::std::ops::FnMut(crate::types::ChainDeleteEdgesRequest) -> crate::types::ExecResponse + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17497 let mut closure = self.closure.lock().unwrap();
17498 *closure = ::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
17499 }
17500
17501 pub fn mock_result(&self, mut mock: impl ::std::ops::FnMut(crate::types::ChainDeleteEdgesRequest) -> ::std::result::Result<crate::types::ExecResponse, crate::errors::internal_storage_service::ChainDeleteEdgesError> + ::std::marker::Send + ::std::marker::Sync + 'mock) {
17502 let mut closure = self.closure.lock().unwrap();
17503 *closure = ::std::boxed::Box::new(move |req| mock(req));
17504 }
17505
17506 pub fn throw<E>(&self, exception: E)
17507 where
17508 E: ::std::convert::Into<crate::errors::internal_storage_service::ChainDeleteEdgesError>,
17509 E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
17510 {
17511 let mut closure = self.closure.lock().unwrap();
17512 *closure = ::std::boxed::Box::new(move |_: crate::types::ChainDeleteEdgesRequest| ::std::result::Result::Err(exception.clone().into()));
17513 }
17514 }
17515 }
17516 }
17517}
17518
17519pub mod errors {
17521 pub mod graph_storage_service {
17523
17524 pub type GetNeighborsError = ::fbthrift::NonthrowingFunctionError;
17525
17526 impl ::std::convert::From<crate::services::graph_storage_service::GetNeighborsExn> for
17527 ::std::result::Result<crate::types::GetNeighborsResponse, GetNeighborsError>
17528 {
17529 fn from(e: crate::services::graph_storage_service::GetNeighborsExn) -> Self {
17530 match e {
17531 crate::services::graph_storage_service::GetNeighborsExn::Success(res) => {
17532 ::std::result::Result::Ok(res)
17533 }
17534 crate::services::graph_storage_service::GetNeighborsExn::ApplicationException(aexn) =>
17535 ::std::result::Result::Err(GetNeighborsError::ApplicationException(aexn)),
17536 }
17537 }
17538 }
17539
17540 pub type GetDstBySrcError = ::fbthrift::NonthrowingFunctionError;
17541
17542 impl ::std::convert::From<crate::services::graph_storage_service::GetDstBySrcExn> for
17543 ::std::result::Result<crate::types::GetDstBySrcResponse, GetDstBySrcError>
17544 {
17545 fn from(e: crate::services::graph_storage_service::GetDstBySrcExn) -> Self {
17546 match e {
17547 crate::services::graph_storage_service::GetDstBySrcExn::Success(res) => {
17548 ::std::result::Result::Ok(res)
17549 }
17550 crate::services::graph_storage_service::GetDstBySrcExn::ApplicationException(aexn) =>
17551 ::std::result::Result::Err(GetDstBySrcError::ApplicationException(aexn)),
17552 }
17553 }
17554 }
17555
17556 pub type GetPropsError = ::fbthrift::NonthrowingFunctionError;
17557
17558 impl ::std::convert::From<crate::services::graph_storage_service::GetPropsExn> for
17559 ::std::result::Result<crate::types::GetPropResponse, GetPropsError>
17560 {
17561 fn from(e: crate::services::graph_storage_service::GetPropsExn) -> Self {
17562 match e {
17563 crate::services::graph_storage_service::GetPropsExn::Success(res) => {
17564 ::std::result::Result::Ok(res)
17565 }
17566 crate::services::graph_storage_service::GetPropsExn::ApplicationException(aexn) =>
17567 ::std::result::Result::Err(GetPropsError::ApplicationException(aexn)),
17568 }
17569 }
17570 }
17571
17572 pub type AddVerticesError = ::fbthrift::NonthrowingFunctionError;
17573
17574 impl ::std::convert::From<crate::services::graph_storage_service::AddVerticesExn> for
17575 ::std::result::Result<crate::types::ExecResponse, AddVerticesError>
17576 {
17577 fn from(e: crate::services::graph_storage_service::AddVerticesExn) -> Self {
17578 match e {
17579 crate::services::graph_storage_service::AddVerticesExn::Success(res) => {
17580 ::std::result::Result::Ok(res)
17581 }
17582 crate::services::graph_storage_service::AddVerticesExn::ApplicationException(aexn) =>
17583 ::std::result::Result::Err(AddVerticesError::ApplicationException(aexn)),
17584 }
17585 }
17586 }
17587
17588 pub type AddEdgesError = ::fbthrift::NonthrowingFunctionError;
17589
17590 impl ::std::convert::From<crate::services::graph_storage_service::AddEdgesExn> for
17591 ::std::result::Result<crate::types::ExecResponse, AddEdgesError>
17592 {
17593 fn from(e: crate::services::graph_storage_service::AddEdgesExn) -> Self {
17594 match e {
17595 crate::services::graph_storage_service::AddEdgesExn::Success(res) => {
17596 ::std::result::Result::Ok(res)
17597 }
17598 crate::services::graph_storage_service::AddEdgesExn::ApplicationException(aexn) =>
17599 ::std::result::Result::Err(AddEdgesError::ApplicationException(aexn)),
17600 }
17601 }
17602 }
17603
17604 pub type DeleteEdgesError = ::fbthrift::NonthrowingFunctionError;
17605
17606 impl ::std::convert::From<crate::services::graph_storage_service::DeleteEdgesExn> for
17607 ::std::result::Result<crate::types::ExecResponse, DeleteEdgesError>
17608 {
17609 fn from(e: crate::services::graph_storage_service::DeleteEdgesExn) -> Self {
17610 match e {
17611 crate::services::graph_storage_service::DeleteEdgesExn::Success(res) => {
17612 ::std::result::Result::Ok(res)
17613 }
17614 crate::services::graph_storage_service::DeleteEdgesExn::ApplicationException(aexn) =>
17615 ::std::result::Result::Err(DeleteEdgesError::ApplicationException(aexn)),
17616 }
17617 }
17618 }
17619
17620 pub type DeleteVerticesError = ::fbthrift::NonthrowingFunctionError;
17621
17622 impl ::std::convert::From<crate::services::graph_storage_service::DeleteVerticesExn> for
17623 ::std::result::Result<crate::types::ExecResponse, DeleteVerticesError>
17624 {
17625 fn from(e: crate::services::graph_storage_service::DeleteVerticesExn) -> Self {
17626 match e {
17627 crate::services::graph_storage_service::DeleteVerticesExn::Success(res) => {
17628 ::std::result::Result::Ok(res)
17629 }
17630 crate::services::graph_storage_service::DeleteVerticesExn::ApplicationException(aexn) =>
17631 ::std::result::Result::Err(DeleteVerticesError::ApplicationException(aexn)),
17632 }
17633 }
17634 }
17635
17636 pub type DeleteTagsError = ::fbthrift::NonthrowingFunctionError;
17637
17638 impl ::std::convert::From<crate::services::graph_storage_service::DeleteTagsExn> for
17639 ::std::result::Result<crate::types::ExecResponse, DeleteTagsError>
17640 {
17641 fn from(e: crate::services::graph_storage_service::DeleteTagsExn) -> Self {
17642 match e {
17643 crate::services::graph_storage_service::DeleteTagsExn::Success(res) => {
17644 ::std::result::Result::Ok(res)
17645 }
17646 crate::services::graph_storage_service::DeleteTagsExn::ApplicationException(aexn) =>
17647 ::std::result::Result::Err(DeleteTagsError::ApplicationException(aexn)),
17648 }
17649 }
17650 }
17651
17652 pub type UpdateVertexError = ::fbthrift::NonthrowingFunctionError;
17653
17654 impl ::std::convert::From<crate::services::graph_storage_service::UpdateVertexExn> for
17655 ::std::result::Result<crate::types::UpdateResponse, UpdateVertexError>
17656 {
17657 fn from(e: crate::services::graph_storage_service::UpdateVertexExn) -> Self {
17658 match e {
17659 crate::services::graph_storage_service::UpdateVertexExn::Success(res) => {
17660 ::std::result::Result::Ok(res)
17661 }
17662 crate::services::graph_storage_service::UpdateVertexExn::ApplicationException(aexn) =>
17663 ::std::result::Result::Err(UpdateVertexError::ApplicationException(aexn)),
17664 }
17665 }
17666 }
17667
17668 pub type UpdateEdgeError = ::fbthrift::NonthrowingFunctionError;
17669
17670 impl ::std::convert::From<crate::services::graph_storage_service::UpdateEdgeExn> for
17671 ::std::result::Result<crate::types::UpdateResponse, UpdateEdgeError>
17672 {
17673 fn from(e: crate::services::graph_storage_service::UpdateEdgeExn) -> Self {
17674 match e {
17675 crate::services::graph_storage_service::UpdateEdgeExn::Success(res) => {
17676 ::std::result::Result::Ok(res)
17677 }
17678 crate::services::graph_storage_service::UpdateEdgeExn::ApplicationException(aexn) =>
17679 ::std::result::Result::Err(UpdateEdgeError::ApplicationException(aexn)),
17680 }
17681 }
17682 }
17683
17684 pub type ScanVertexError = ::fbthrift::NonthrowingFunctionError;
17685
17686 impl ::std::convert::From<crate::services::graph_storage_service::ScanVertexExn> for
17687 ::std::result::Result<crate::types::ScanResponse, ScanVertexError>
17688 {
17689 fn from(e: crate::services::graph_storage_service::ScanVertexExn) -> Self {
17690 match e {
17691 crate::services::graph_storage_service::ScanVertexExn::Success(res) => {
17692 ::std::result::Result::Ok(res)
17693 }
17694 crate::services::graph_storage_service::ScanVertexExn::ApplicationException(aexn) =>
17695 ::std::result::Result::Err(ScanVertexError::ApplicationException(aexn)),
17696 }
17697 }
17698 }
17699
17700 pub type ScanEdgeError = ::fbthrift::NonthrowingFunctionError;
17701
17702 impl ::std::convert::From<crate::services::graph_storage_service::ScanEdgeExn> for
17703 ::std::result::Result<crate::types::ScanResponse, ScanEdgeError>
17704 {
17705 fn from(e: crate::services::graph_storage_service::ScanEdgeExn) -> Self {
17706 match e {
17707 crate::services::graph_storage_service::ScanEdgeExn::Success(res) => {
17708 ::std::result::Result::Ok(res)
17709 }
17710 crate::services::graph_storage_service::ScanEdgeExn::ApplicationException(aexn) =>
17711 ::std::result::Result::Err(ScanEdgeError::ApplicationException(aexn)),
17712 }
17713 }
17714 }
17715
17716 pub type GetUUIDError = ::fbthrift::NonthrowingFunctionError;
17717
17718 impl ::std::convert::From<crate::services::graph_storage_service::GetUUIDExn> for
17719 ::std::result::Result<crate::types::GetUUIDResp, GetUUIDError>
17720 {
17721 fn from(e: crate::services::graph_storage_service::GetUUIDExn) -> Self {
17722 match e {
17723 crate::services::graph_storage_service::GetUUIDExn::Success(res) => {
17724 ::std::result::Result::Ok(res)
17725 }
17726 crate::services::graph_storage_service::GetUUIDExn::ApplicationException(aexn) =>
17727 ::std::result::Result::Err(GetUUIDError::ApplicationException(aexn)),
17728 }
17729 }
17730 }
17731
17732 pub type LookupIndexError = ::fbthrift::NonthrowingFunctionError;
17733
17734 impl ::std::convert::From<crate::services::graph_storage_service::LookupIndexExn> for
17735 ::std::result::Result<crate::types::LookupIndexResp, LookupIndexError>
17736 {
17737 fn from(e: crate::services::graph_storage_service::LookupIndexExn) -> Self {
17738 match e {
17739 crate::services::graph_storage_service::LookupIndexExn::Success(res) => {
17740 ::std::result::Result::Ok(res)
17741 }
17742 crate::services::graph_storage_service::LookupIndexExn::ApplicationException(aexn) =>
17743 ::std::result::Result::Err(LookupIndexError::ApplicationException(aexn)),
17744 }
17745 }
17746 }
17747
17748 pub type LookupAndTraverseError = ::fbthrift::NonthrowingFunctionError;
17749
17750 impl ::std::convert::From<crate::services::graph_storage_service::LookupAndTraverseExn> for
17751 ::std::result::Result<crate::types::GetNeighborsResponse, LookupAndTraverseError>
17752 {
17753 fn from(e: crate::services::graph_storage_service::LookupAndTraverseExn) -> Self {
17754 match e {
17755 crate::services::graph_storage_service::LookupAndTraverseExn::Success(res) => {
17756 ::std::result::Result::Ok(res)
17757 }
17758 crate::services::graph_storage_service::LookupAndTraverseExn::ApplicationException(aexn) =>
17759 ::std::result::Result::Err(LookupAndTraverseError::ApplicationException(aexn)),
17760 }
17761 }
17762 }
17763
17764 pub type ChainUpdateEdgeError = ::fbthrift::NonthrowingFunctionError;
17765
17766 impl ::std::convert::From<crate::services::graph_storage_service::ChainUpdateEdgeExn> for
17767 ::std::result::Result<crate::types::UpdateResponse, ChainUpdateEdgeError>
17768 {
17769 fn from(e: crate::services::graph_storage_service::ChainUpdateEdgeExn) -> Self {
17770 match e {
17771 crate::services::graph_storage_service::ChainUpdateEdgeExn::Success(res) => {
17772 ::std::result::Result::Ok(res)
17773 }
17774 crate::services::graph_storage_service::ChainUpdateEdgeExn::ApplicationException(aexn) =>
17775 ::std::result::Result::Err(ChainUpdateEdgeError::ApplicationException(aexn)),
17776 }
17777 }
17778 }
17779
17780 pub type ChainAddEdgesError = ::fbthrift::NonthrowingFunctionError;
17781
17782 impl ::std::convert::From<crate::services::graph_storage_service::ChainAddEdgesExn> for
17783 ::std::result::Result<crate::types::ExecResponse, ChainAddEdgesError>
17784 {
17785 fn from(e: crate::services::graph_storage_service::ChainAddEdgesExn) -> Self {
17786 match e {
17787 crate::services::graph_storage_service::ChainAddEdgesExn::Success(res) => {
17788 ::std::result::Result::Ok(res)
17789 }
17790 crate::services::graph_storage_service::ChainAddEdgesExn::ApplicationException(aexn) =>
17791 ::std::result::Result::Err(ChainAddEdgesError::ApplicationException(aexn)),
17792 }
17793 }
17794 }
17795
17796 pub type ChainDeleteEdgesError = ::fbthrift::NonthrowingFunctionError;
17797
17798 impl ::std::convert::From<crate::services::graph_storage_service::ChainDeleteEdgesExn> for
17799 ::std::result::Result<crate::types::ExecResponse, ChainDeleteEdgesError>
17800 {
17801 fn from(e: crate::services::graph_storage_service::ChainDeleteEdgesExn) -> Self {
17802 match e {
17803 crate::services::graph_storage_service::ChainDeleteEdgesExn::Success(res) => {
17804 ::std::result::Result::Ok(res)
17805 }
17806 crate::services::graph_storage_service::ChainDeleteEdgesExn::ApplicationException(aexn) =>
17807 ::std::result::Result::Err(ChainDeleteEdgesError::ApplicationException(aexn)),
17808 }
17809 }
17810 }
17811
17812 pub type GetError = ::fbthrift::NonthrowingFunctionError;
17813
17814 impl ::std::convert::From<crate::services::graph_storage_service::GetExn> for
17815 ::std::result::Result<crate::types::KVGetResponse, GetError>
17816 {
17817 fn from(e: crate::services::graph_storage_service::GetExn) -> Self {
17818 match e {
17819 crate::services::graph_storage_service::GetExn::Success(res) => {
17820 ::std::result::Result::Ok(res)
17821 }
17822 crate::services::graph_storage_service::GetExn::ApplicationException(aexn) =>
17823 ::std::result::Result::Err(GetError::ApplicationException(aexn)),
17824 }
17825 }
17826 }
17827
17828 pub type PutError = ::fbthrift::NonthrowingFunctionError;
17829
17830 impl ::std::convert::From<crate::services::graph_storage_service::PutExn> for
17831 ::std::result::Result<crate::types::ExecResponse, PutError>
17832 {
17833 fn from(e: crate::services::graph_storage_service::PutExn) -> Self {
17834 match e {
17835 crate::services::graph_storage_service::PutExn::Success(res) => {
17836 ::std::result::Result::Ok(res)
17837 }
17838 crate::services::graph_storage_service::PutExn::ApplicationException(aexn) =>
17839 ::std::result::Result::Err(PutError::ApplicationException(aexn)),
17840 }
17841 }
17842 }
17843
17844 pub type RemoveError = ::fbthrift::NonthrowingFunctionError;
17845
17846 impl ::std::convert::From<crate::services::graph_storage_service::RemoveExn> for
17847 ::std::result::Result<crate::types::ExecResponse, RemoveError>
17848 {
17849 fn from(e: crate::services::graph_storage_service::RemoveExn) -> Self {
17850 match e {
17851 crate::services::graph_storage_service::RemoveExn::Success(res) => {
17852 ::std::result::Result::Ok(res)
17853 }
17854 crate::services::graph_storage_service::RemoveExn::ApplicationException(aexn) =>
17855 ::std::result::Result::Err(RemoveError::ApplicationException(aexn)),
17856 }
17857 }
17858 }
17859
17860 }
17861
17862 pub mod storage_admin_service {
17864
17865 pub type TransLeaderError = ::fbthrift::NonthrowingFunctionError;
17866
17867 impl ::std::convert::From<crate::services::storage_admin_service::TransLeaderExn> for
17868 ::std::result::Result<crate::types::AdminExecResp, TransLeaderError>
17869 {
17870 fn from(e: crate::services::storage_admin_service::TransLeaderExn) -> Self {
17871 match e {
17872 crate::services::storage_admin_service::TransLeaderExn::Success(res) => {
17873 ::std::result::Result::Ok(res)
17874 }
17875 crate::services::storage_admin_service::TransLeaderExn::ApplicationException(aexn) =>
17876 ::std::result::Result::Err(TransLeaderError::ApplicationException(aexn)),
17877 }
17878 }
17879 }
17880
17881 pub type AddPartError = ::fbthrift::NonthrowingFunctionError;
17882
17883 impl ::std::convert::From<crate::services::storage_admin_service::AddPartExn> for
17884 ::std::result::Result<crate::types::AdminExecResp, AddPartError>
17885 {
17886 fn from(e: crate::services::storage_admin_service::AddPartExn) -> Self {
17887 match e {
17888 crate::services::storage_admin_service::AddPartExn::Success(res) => {
17889 ::std::result::Result::Ok(res)
17890 }
17891 crate::services::storage_admin_service::AddPartExn::ApplicationException(aexn) =>
17892 ::std::result::Result::Err(AddPartError::ApplicationException(aexn)),
17893 }
17894 }
17895 }
17896
17897 pub type AddLearnerError = ::fbthrift::NonthrowingFunctionError;
17898
17899 impl ::std::convert::From<crate::services::storage_admin_service::AddLearnerExn> for
17900 ::std::result::Result<crate::types::AdminExecResp, AddLearnerError>
17901 {
17902 fn from(e: crate::services::storage_admin_service::AddLearnerExn) -> Self {
17903 match e {
17904 crate::services::storage_admin_service::AddLearnerExn::Success(res) => {
17905 ::std::result::Result::Ok(res)
17906 }
17907 crate::services::storage_admin_service::AddLearnerExn::ApplicationException(aexn) =>
17908 ::std::result::Result::Err(AddLearnerError::ApplicationException(aexn)),
17909 }
17910 }
17911 }
17912
17913 pub type RemovePartError = ::fbthrift::NonthrowingFunctionError;
17914
17915 impl ::std::convert::From<crate::services::storage_admin_service::RemovePartExn> for
17916 ::std::result::Result<crate::types::AdminExecResp, RemovePartError>
17917 {
17918 fn from(e: crate::services::storage_admin_service::RemovePartExn) -> Self {
17919 match e {
17920 crate::services::storage_admin_service::RemovePartExn::Success(res) => {
17921 ::std::result::Result::Ok(res)
17922 }
17923 crate::services::storage_admin_service::RemovePartExn::ApplicationException(aexn) =>
17924 ::std::result::Result::Err(RemovePartError::ApplicationException(aexn)),
17925 }
17926 }
17927 }
17928
17929 pub type MemberChangeError = ::fbthrift::NonthrowingFunctionError;
17930
17931 impl ::std::convert::From<crate::services::storage_admin_service::MemberChangeExn> for
17932 ::std::result::Result<crate::types::AdminExecResp, MemberChangeError>
17933 {
17934 fn from(e: crate::services::storage_admin_service::MemberChangeExn) -> Self {
17935 match e {
17936 crate::services::storage_admin_service::MemberChangeExn::Success(res) => {
17937 ::std::result::Result::Ok(res)
17938 }
17939 crate::services::storage_admin_service::MemberChangeExn::ApplicationException(aexn) =>
17940 ::std::result::Result::Err(MemberChangeError::ApplicationException(aexn)),
17941 }
17942 }
17943 }
17944
17945 pub type WaitingForCatchUpDataError = ::fbthrift::NonthrowingFunctionError;
17946
17947 impl ::std::convert::From<crate::services::storage_admin_service::WaitingForCatchUpDataExn> for
17948 ::std::result::Result<crate::types::AdminExecResp, WaitingForCatchUpDataError>
17949 {
17950 fn from(e: crate::services::storage_admin_service::WaitingForCatchUpDataExn) -> Self {
17951 match e {
17952 crate::services::storage_admin_service::WaitingForCatchUpDataExn::Success(res) => {
17953 ::std::result::Result::Ok(res)
17954 }
17955 crate::services::storage_admin_service::WaitingForCatchUpDataExn::ApplicationException(aexn) =>
17956 ::std::result::Result::Err(WaitingForCatchUpDataError::ApplicationException(aexn)),
17957 }
17958 }
17959 }
17960
17961 pub type CreateCheckpointError = ::fbthrift::NonthrowingFunctionError;
17962
17963 impl ::std::convert::From<crate::services::storage_admin_service::CreateCheckpointExn> for
17964 ::std::result::Result<crate::types::CreateCPResp, CreateCheckpointError>
17965 {
17966 fn from(e: crate::services::storage_admin_service::CreateCheckpointExn) -> Self {
17967 match e {
17968 crate::services::storage_admin_service::CreateCheckpointExn::Success(res) => {
17969 ::std::result::Result::Ok(res)
17970 }
17971 crate::services::storage_admin_service::CreateCheckpointExn::ApplicationException(aexn) =>
17972 ::std::result::Result::Err(CreateCheckpointError::ApplicationException(aexn)),
17973 }
17974 }
17975 }
17976
17977 pub type DropCheckpointError = ::fbthrift::NonthrowingFunctionError;
17978
17979 impl ::std::convert::From<crate::services::storage_admin_service::DropCheckpointExn> for
17980 ::std::result::Result<crate::types::DropCPResp, DropCheckpointError>
17981 {
17982 fn from(e: crate::services::storage_admin_service::DropCheckpointExn) -> Self {
17983 match e {
17984 crate::services::storage_admin_service::DropCheckpointExn::Success(res) => {
17985 ::std::result::Result::Ok(res)
17986 }
17987 crate::services::storage_admin_service::DropCheckpointExn::ApplicationException(aexn) =>
17988 ::std::result::Result::Err(DropCheckpointError::ApplicationException(aexn)),
17989 }
17990 }
17991 }
17992
17993 pub type BlockingWritesError = ::fbthrift::NonthrowingFunctionError;
17994
17995 impl ::std::convert::From<crate::services::storage_admin_service::BlockingWritesExn> for
17996 ::std::result::Result<crate::types::BlockingSignResp, BlockingWritesError>
17997 {
17998 fn from(e: crate::services::storage_admin_service::BlockingWritesExn) -> Self {
17999 match e {
18000 crate::services::storage_admin_service::BlockingWritesExn::Success(res) => {
18001 ::std::result::Result::Ok(res)
18002 }
18003 crate::services::storage_admin_service::BlockingWritesExn::ApplicationException(aexn) =>
18004 ::std::result::Result::Err(BlockingWritesError::ApplicationException(aexn)),
18005 }
18006 }
18007 }
18008
18009 pub type GetLeaderPartsError = ::fbthrift::NonthrowingFunctionError;
18010
18011 impl ::std::convert::From<crate::services::storage_admin_service::GetLeaderPartsExn> for
18012 ::std::result::Result<crate::types::GetLeaderPartsResp, GetLeaderPartsError>
18013 {
18014 fn from(e: crate::services::storage_admin_service::GetLeaderPartsExn) -> Self {
18015 match e {
18016 crate::services::storage_admin_service::GetLeaderPartsExn::Success(res) => {
18017 ::std::result::Result::Ok(res)
18018 }
18019 crate::services::storage_admin_service::GetLeaderPartsExn::ApplicationException(aexn) =>
18020 ::std::result::Result::Err(GetLeaderPartsError::ApplicationException(aexn)),
18021 }
18022 }
18023 }
18024
18025 pub type CheckPeersError = ::fbthrift::NonthrowingFunctionError;
18026
18027 impl ::std::convert::From<crate::services::storage_admin_service::CheckPeersExn> for
18028 ::std::result::Result<crate::types::AdminExecResp, CheckPeersError>
18029 {
18030 fn from(e: crate::services::storage_admin_service::CheckPeersExn) -> Self {
18031 match e {
18032 crate::services::storage_admin_service::CheckPeersExn::Success(res) => {
18033 ::std::result::Result::Ok(res)
18034 }
18035 crate::services::storage_admin_service::CheckPeersExn::ApplicationException(aexn) =>
18036 ::std::result::Result::Err(CheckPeersError::ApplicationException(aexn)),
18037 }
18038 }
18039 }
18040
18041 pub type AddAdminTaskError = ::fbthrift::NonthrowingFunctionError;
18042
18043 impl ::std::convert::From<crate::services::storage_admin_service::AddAdminTaskExn> for
18044 ::std::result::Result<crate::types::AddTaskResp, AddAdminTaskError>
18045 {
18046 fn from(e: crate::services::storage_admin_service::AddAdminTaskExn) -> Self {
18047 match e {
18048 crate::services::storage_admin_service::AddAdminTaskExn::Success(res) => {
18049 ::std::result::Result::Ok(res)
18050 }
18051 crate::services::storage_admin_service::AddAdminTaskExn::ApplicationException(aexn) =>
18052 ::std::result::Result::Err(AddAdminTaskError::ApplicationException(aexn)),
18053 }
18054 }
18055 }
18056
18057 pub type StopAdminTaskError = ::fbthrift::NonthrowingFunctionError;
18058
18059 impl ::std::convert::From<crate::services::storage_admin_service::StopAdminTaskExn> for
18060 ::std::result::Result<crate::types::StopTaskResp, StopAdminTaskError>
18061 {
18062 fn from(e: crate::services::storage_admin_service::StopAdminTaskExn) -> Self {
18063 match e {
18064 crate::services::storage_admin_service::StopAdminTaskExn::Success(res) => {
18065 ::std::result::Result::Ok(res)
18066 }
18067 crate::services::storage_admin_service::StopAdminTaskExn::ApplicationException(aexn) =>
18068 ::std::result::Result::Err(StopAdminTaskError::ApplicationException(aexn)),
18069 }
18070 }
18071 }
18072
18073 pub type ClearSpaceError = ::fbthrift::NonthrowingFunctionError;
18074
18075 impl ::std::convert::From<crate::services::storage_admin_service::ClearSpaceExn> for
18076 ::std::result::Result<crate::types::ClearSpaceResp, ClearSpaceError>
18077 {
18078 fn from(e: crate::services::storage_admin_service::ClearSpaceExn) -> Self {
18079 match e {
18080 crate::services::storage_admin_service::ClearSpaceExn::Success(res) => {
18081 ::std::result::Result::Ok(res)
18082 }
18083 crate::services::storage_admin_service::ClearSpaceExn::ApplicationException(aexn) =>
18084 ::std::result::Result::Err(ClearSpaceError::ApplicationException(aexn)),
18085 }
18086 }
18087 }
18088
18089 }
18090
18091 pub mod internal_storage_service {
18093
18094 pub type ChainAddEdgesError = ::fbthrift::NonthrowingFunctionError;
18095
18096 impl ::std::convert::From<crate::services::internal_storage_service::ChainAddEdgesExn> for
18097 ::std::result::Result<crate::types::ExecResponse, ChainAddEdgesError>
18098 {
18099 fn from(e: crate::services::internal_storage_service::ChainAddEdgesExn) -> Self {
18100 match e {
18101 crate::services::internal_storage_service::ChainAddEdgesExn::Success(res) => {
18102 ::std::result::Result::Ok(res)
18103 }
18104 crate::services::internal_storage_service::ChainAddEdgesExn::ApplicationException(aexn) =>
18105 ::std::result::Result::Err(ChainAddEdgesError::ApplicationException(aexn)),
18106 }
18107 }
18108 }
18109
18110 pub type ChainUpdateEdgeError = ::fbthrift::NonthrowingFunctionError;
18111
18112 impl ::std::convert::From<crate::services::internal_storage_service::ChainUpdateEdgeExn> for
18113 ::std::result::Result<crate::types::UpdateResponse, ChainUpdateEdgeError>
18114 {
18115 fn from(e: crate::services::internal_storage_service::ChainUpdateEdgeExn) -> Self {
18116 match e {
18117 crate::services::internal_storage_service::ChainUpdateEdgeExn::Success(res) => {
18118 ::std::result::Result::Ok(res)
18119 }
18120 crate::services::internal_storage_service::ChainUpdateEdgeExn::ApplicationException(aexn) =>
18121 ::std::result::Result::Err(ChainUpdateEdgeError::ApplicationException(aexn)),
18122 }
18123 }
18124 }
18125
18126 pub type ChainDeleteEdgesError = ::fbthrift::NonthrowingFunctionError;
18127
18128 impl ::std::convert::From<crate::services::internal_storage_service::ChainDeleteEdgesExn> for
18129 ::std::result::Result<crate::types::ExecResponse, ChainDeleteEdgesError>
18130 {
18131 fn from(e: crate::services::internal_storage_service::ChainDeleteEdgesExn) -> Self {
18132 match e {
18133 crate::services::internal_storage_service::ChainDeleteEdgesExn::Success(res) => {
18134 ::std::result::Result::Ok(res)
18135 }
18136 crate::services::internal_storage_service::ChainDeleteEdgesExn::ApplicationException(aexn) =>
18137 ::std::result::Result::Err(ChainDeleteEdgesError::ApplicationException(aexn)),
18138 }
18139 }
18140 }
18141
18142 }
18143
18144}