1mod _accessor_impls {
2 #![allow(clippy::useless_conversion)]
3 impl super::GetCheckpointObjectProofRequest {
4 pub const fn const_default() -> Self {
5 Self {
6 object_id: None,
7 checkpoint: None,
8 }
9 }
10 #[doc(hidden)]
11 pub fn default_instance() -> &'static Self {
12 static DEFAULT: super::GetCheckpointObjectProofRequest = super::GetCheckpointObjectProofRequest::const_default();
13 &DEFAULT
14 }
15 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
17 self.object_id.as_mut().map(|field| field as _)
18 }
19 pub fn object_id_mut(&mut self) -> &mut String {
22 self.object_id.get_or_insert_default()
23 }
24 pub fn object_id_opt(&self) -> Option<&str> {
26 self.object_id.as_ref().map(|field| field as _)
27 }
28 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
30 self.object_id = Some(field.into().into());
31 }
32 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
34 self.set_object_id(field.into());
35 self
36 }
37 pub fn checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
39 self.checkpoint.as_mut().map(|field| field as _)
40 }
41 pub fn checkpoint_mut(&mut self) -> &mut u64 {
44 self.checkpoint.get_or_insert_default()
45 }
46 pub fn checkpoint_opt(&self) -> Option<u64> {
48 self.checkpoint.as_ref().map(|field| *field)
49 }
50 pub fn set_checkpoint(&mut self, field: u64) {
52 self.checkpoint = Some(field);
53 }
54 pub fn with_checkpoint(mut self, field: u64) -> Self {
56 self.set_checkpoint(field);
57 self
58 }
59 }
60 impl super::GetCheckpointObjectProofResponse {
61 pub const fn const_default() -> Self {
62 Self {
63 checkpoint_summary: None,
64 proof: None,
65 }
66 }
67 #[doc(hidden)]
68 pub fn default_instance() -> &'static Self {
69 static DEFAULT: super::GetCheckpointObjectProofResponse = super::GetCheckpointObjectProofResponse::const_default();
70 &DEFAULT
71 }
72 pub fn checkpoint_summary_opt(&self) -> Option<&[u8]> {
74 self.checkpoint_summary.as_ref().map(|field| field as _)
75 }
76 pub fn set_checkpoint_summary<T: Into<::prost::bytes::Bytes>>(
78 &mut self,
79 field: T,
80 ) {
81 self.checkpoint_summary = Some(field.into().into());
82 }
83 pub fn with_checkpoint_summary<T: Into<::prost::bytes::Bytes>>(
85 mut self,
86 field: T,
87 ) -> Self {
88 self.set_checkpoint_summary(field.into());
89 self
90 }
91 pub fn inclusion(&self) -> &super::OcsInclusionProof {
93 if let Some(
94 super::get_checkpoint_object_proof_response::Proof::Inclusion(field),
95 ) = &self.proof
96 {
97 field as _
98 } else {
99 super::OcsInclusionProof::default_instance() as _
100 }
101 }
102 pub fn inclusion_opt(&self) -> Option<&super::OcsInclusionProof> {
104 if let Some(
105 super::get_checkpoint_object_proof_response::Proof::Inclusion(field),
106 ) = &self.proof
107 {
108 Some(field as _)
109 } else {
110 None
111 }
112 }
113 pub fn inclusion_opt_mut(&mut self) -> Option<&mut super::OcsInclusionProof> {
115 if let Some(
116 super::get_checkpoint_object_proof_response::Proof::Inclusion(field),
117 ) = &mut self.proof
118 {
119 Some(field as _)
120 } else {
121 None
122 }
123 }
124 pub fn inclusion_mut(&mut self) -> &mut super::OcsInclusionProof {
128 if self.inclusion_opt_mut().is_none() {
129 self.proof = Some(
130 super::get_checkpoint_object_proof_response::Proof::Inclusion(
131 super::OcsInclusionProof::default(),
132 ),
133 );
134 }
135 self.inclusion_opt_mut().unwrap()
136 }
137 pub fn set_inclusion<T: Into<super::OcsInclusionProof>>(&mut self, field: T) {
140 self.proof = Some(
141 super::get_checkpoint_object_proof_response::Proof::Inclusion(
142 field.into().into(),
143 ),
144 );
145 }
146 pub fn with_inclusion<T: Into<super::OcsInclusionProof>>(
149 mut self,
150 field: T,
151 ) -> Self {
152 self.set_inclusion(field.into());
153 self
154 }
155 pub fn non_inclusion(&self) -> &super::OcsNonInclusionProof {
157 if let Some(
158 super::get_checkpoint_object_proof_response::Proof::NonInclusion(field),
159 ) = &self.proof
160 {
161 field as _
162 } else {
163 super::OcsNonInclusionProof::default_instance() as _
164 }
165 }
166 pub fn non_inclusion_opt(&self) -> Option<&super::OcsNonInclusionProof> {
168 if let Some(
169 super::get_checkpoint_object_proof_response::Proof::NonInclusion(field),
170 ) = &self.proof
171 {
172 Some(field as _)
173 } else {
174 None
175 }
176 }
177 pub fn non_inclusion_opt_mut(
179 &mut self,
180 ) -> Option<&mut super::OcsNonInclusionProof> {
181 if let Some(
182 super::get_checkpoint_object_proof_response::Proof::NonInclusion(field),
183 ) = &mut self.proof
184 {
185 Some(field as _)
186 } else {
187 None
188 }
189 }
190 pub fn non_inclusion_mut(&mut self) -> &mut super::OcsNonInclusionProof {
194 if self.non_inclusion_opt_mut().is_none() {
195 self.proof = Some(
196 super::get_checkpoint_object_proof_response::Proof::NonInclusion(
197 super::OcsNonInclusionProof::default(),
198 ),
199 );
200 }
201 self.non_inclusion_opt_mut().unwrap()
202 }
203 pub fn set_non_inclusion<T: Into<super::OcsNonInclusionProof>>(
206 &mut self,
207 field: T,
208 ) {
209 self.proof = Some(
210 super::get_checkpoint_object_proof_response::Proof::NonInclusion(
211 field.into().into(),
212 ),
213 );
214 }
215 pub fn with_non_inclusion<T: Into<super::OcsNonInclusionProof>>(
218 mut self,
219 field: T,
220 ) -> Self {
221 self.set_non_inclusion(field.into());
222 self
223 }
224 }
225 impl super::MerkleNeighbourLeaf {
226 pub const fn const_default() -> Self {
227 Self {
228 leaf: None,
229 merkle_proof: None,
230 }
231 }
232 #[doc(hidden)]
233 pub fn default_instance() -> &'static Self {
234 static DEFAULT: super::MerkleNeighbourLeaf = super::MerkleNeighbourLeaf::const_default();
235 &DEFAULT
236 }
237 pub fn leaf(&self) -> &super::super::v2::ObjectReference {
239 self.leaf
240 .as_ref()
241 .map(|field| field as _)
242 .unwrap_or_else(|| {
243 super::super::v2::ObjectReference::default_instance() as _
244 })
245 }
246 pub fn leaf_opt_mut(
248 &mut self,
249 ) -> Option<&mut super::super::v2::ObjectReference> {
250 self.leaf.as_mut().map(|field| field as _)
251 }
252 pub fn leaf_mut(&mut self) -> &mut super::super::v2::ObjectReference {
255 self.leaf.get_or_insert_default()
256 }
257 pub fn leaf_opt(&self) -> Option<&super::super::v2::ObjectReference> {
259 self.leaf.as_ref().map(|field| field as _)
260 }
261 pub fn set_leaf<T: Into<super::super::v2::ObjectReference>>(
263 &mut self,
264 field: T,
265 ) {
266 self.leaf = Some(field.into().into());
267 }
268 pub fn with_leaf<T: Into<super::super::v2::ObjectReference>>(
270 mut self,
271 field: T,
272 ) -> Self {
273 self.set_leaf(field.into());
274 self
275 }
276 pub fn merkle_proof(&self) -> &super::MerkleProof {
278 self.merkle_proof
279 .as_ref()
280 .map(|field| field as _)
281 .unwrap_or_else(|| super::MerkleProof::default_instance() as _)
282 }
283 pub fn merkle_proof_opt_mut(&mut self) -> Option<&mut super::MerkleProof> {
285 self.merkle_proof.as_mut().map(|field| field as _)
286 }
287 pub fn merkle_proof_mut(&mut self) -> &mut super::MerkleProof {
290 self.merkle_proof.get_or_insert_default()
291 }
292 pub fn merkle_proof_opt(&self) -> Option<&super::MerkleProof> {
294 self.merkle_proof.as_ref().map(|field| field as _)
295 }
296 pub fn set_merkle_proof<T: Into<super::MerkleProof>>(&mut self, field: T) {
298 self.merkle_proof = Some(field.into().into());
299 }
300 pub fn with_merkle_proof<T: Into<super::MerkleProof>>(
302 mut self,
303 field: T,
304 ) -> Self {
305 self.set_merkle_proof(field.into());
306 self
307 }
308 }
309 impl super::MerkleNode {
310 pub const fn const_default() -> Self {
311 Self { node: None }
312 }
313 #[doc(hidden)]
314 pub fn default_instance() -> &'static Self {
315 static DEFAULT: super::MerkleNode = super::MerkleNode::const_default();
316 &DEFAULT
317 }
318 pub fn digest(&self) -> &[u8] {
320 if let Some(super::merkle_node::Node::Digest(field)) = &self.node {
321 field as _
322 } else {
323 &[]
324 }
325 }
326 pub fn digest_opt(&self) -> Option<&[u8]> {
328 if let Some(super::merkle_node::Node::Digest(field)) = &self.node {
329 Some(field as _)
330 } else {
331 None
332 }
333 }
334 pub fn digest_opt_mut(&mut self) -> Option<&mut ::prost::bytes::Bytes> {
336 if let Some(super::merkle_node::Node::Digest(field)) = &mut self.node {
337 Some(field as _)
338 } else {
339 None
340 }
341 }
342 pub fn digest_mut(&mut self) -> &mut ::prost::bytes::Bytes {
346 if self.digest_opt_mut().is_none() {
347 self.node = Some(
348 super::merkle_node::Node::Digest(::prost::bytes::Bytes::default()),
349 );
350 }
351 self.digest_opt_mut().unwrap()
352 }
353 pub fn set_digest<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
356 self.node = Some(super::merkle_node::Node::Digest(field.into().into()));
357 }
358 pub fn with_digest<T: Into<::prost::bytes::Bytes>>(mut self, field: T) -> Self {
361 self.set_digest(field.into());
362 self
363 }
364 }
365 impl super::MerkleNonInclusionProof {
366 pub const fn const_default() -> Self {
367 Self {
368 index: None,
369 left_leaf: None,
370 right_leaf: None,
371 }
372 }
373 #[doc(hidden)]
374 pub fn default_instance() -> &'static Self {
375 static DEFAULT: super::MerkleNonInclusionProof = super::MerkleNonInclusionProof::const_default();
376 &DEFAULT
377 }
378 pub fn index_opt_mut(&mut self) -> Option<&mut u64> {
380 self.index.as_mut().map(|field| field as _)
381 }
382 pub fn index_mut(&mut self) -> &mut u64 {
385 self.index.get_or_insert_default()
386 }
387 pub fn index_opt(&self) -> Option<u64> {
389 self.index.as_ref().map(|field| *field)
390 }
391 pub fn set_index(&mut self, field: u64) {
393 self.index = Some(field);
394 }
395 pub fn with_index(mut self, field: u64) -> Self {
397 self.set_index(field);
398 self
399 }
400 pub fn left_leaf(&self) -> &super::MerkleNeighbourLeaf {
402 self.left_leaf
403 .as_ref()
404 .map(|field| field as _)
405 .unwrap_or_else(|| super::MerkleNeighbourLeaf::default_instance() as _)
406 }
407 pub fn left_leaf_opt_mut(&mut self) -> Option<&mut super::MerkleNeighbourLeaf> {
409 self.left_leaf.as_mut().map(|field| field as _)
410 }
411 pub fn left_leaf_mut(&mut self) -> &mut super::MerkleNeighbourLeaf {
414 self.left_leaf.get_or_insert_default()
415 }
416 pub fn left_leaf_opt(&self) -> Option<&super::MerkleNeighbourLeaf> {
418 self.left_leaf.as_ref().map(|field| field as _)
419 }
420 pub fn set_left_leaf<T: Into<super::MerkleNeighbourLeaf>>(&mut self, field: T) {
422 self.left_leaf = Some(field.into().into());
423 }
424 pub fn with_left_leaf<T: Into<super::MerkleNeighbourLeaf>>(
426 mut self,
427 field: T,
428 ) -> Self {
429 self.set_left_leaf(field.into());
430 self
431 }
432 pub fn right_leaf(&self) -> &super::MerkleNeighbourLeaf {
434 self.right_leaf
435 .as_ref()
436 .map(|field| field as _)
437 .unwrap_or_else(|| super::MerkleNeighbourLeaf::default_instance() as _)
438 }
439 pub fn right_leaf_opt_mut(&mut self) -> Option<&mut super::MerkleNeighbourLeaf> {
441 self.right_leaf.as_mut().map(|field| field as _)
442 }
443 pub fn right_leaf_mut(&mut self) -> &mut super::MerkleNeighbourLeaf {
446 self.right_leaf.get_or_insert_default()
447 }
448 pub fn right_leaf_opt(&self) -> Option<&super::MerkleNeighbourLeaf> {
450 self.right_leaf.as_ref().map(|field| field as _)
451 }
452 pub fn set_right_leaf<T: Into<super::MerkleNeighbourLeaf>>(&mut self, field: T) {
454 self.right_leaf = Some(field.into().into());
455 }
456 pub fn with_right_leaf<T: Into<super::MerkleNeighbourLeaf>>(
458 mut self,
459 field: T,
460 ) -> Self {
461 self.set_right_leaf(field.into());
462 self
463 }
464 }
465 impl super::MerkleProof {
466 pub const fn const_default() -> Self {
467 Self { path: Vec::new() }
468 }
469 #[doc(hidden)]
470 pub fn default_instance() -> &'static Self {
471 static DEFAULT: super::MerkleProof = super::MerkleProof::const_default();
472 &DEFAULT
473 }
474 pub fn path(&self) -> &[super::MerkleNode] {
476 &self.path
477 }
478 pub fn path_mut(&mut self) -> &mut Vec<super::MerkleNode> {
481 &mut self.path
482 }
483 pub fn set_path(&mut self, field: Vec<super::MerkleNode>) {
485 self.path = field;
486 }
487 pub fn with_path(mut self, field: Vec<super::MerkleNode>) -> Self {
489 self.set_path(field);
490 self
491 }
492 }
493 impl super::OcsInclusionProof {
494 pub const fn const_default() -> Self {
495 Self {
496 object_ref: None,
497 merkle_proof: None,
498 leaf_index: None,
499 tree_root: None,
500 object_data: None,
501 }
502 }
503 #[doc(hidden)]
504 pub fn default_instance() -> &'static Self {
505 static DEFAULT: super::OcsInclusionProof = super::OcsInclusionProof::const_default();
506 &DEFAULT
507 }
508 pub fn object_ref(&self) -> &super::super::v2::ObjectReference {
510 self.object_ref
511 .as_ref()
512 .map(|field| field as _)
513 .unwrap_or_else(|| {
514 super::super::v2::ObjectReference::default_instance() as _
515 })
516 }
517 pub fn object_ref_opt_mut(
519 &mut self,
520 ) -> Option<&mut super::super::v2::ObjectReference> {
521 self.object_ref.as_mut().map(|field| field as _)
522 }
523 pub fn object_ref_mut(&mut self) -> &mut super::super::v2::ObjectReference {
526 self.object_ref.get_or_insert_default()
527 }
528 pub fn object_ref_opt(&self) -> Option<&super::super::v2::ObjectReference> {
530 self.object_ref.as_ref().map(|field| field as _)
531 }
532 pub fn set_object_ref<T: Into<super::super::v2::ObjectReference>>(
534 &mut self,
535 field: T,
536 ) {
537 self.object_ref = Some(field.into().into());
538 }
539 pub fn with_object_ref<T: Into<super::super::v2::ObjectReference>>(
541 mut self,
542 field: T,
543 ) -> Self {
544 self.set_object_ref(field.into());
545 self
546 }
547 pub fn merkle_proof(&self) -> &super::MerkleProof {
549 self.merkle_proof
550 .as_ref()
551 .map(|field| field as _)
552 .unwrap_or_else(|| super::MerkleProof::default_instance() as _)
553 }
554 pub fn merkle_proof_opt_mut(&mut self) -> Option<&mut super::MerkleProof> {
556 self.merkle_proof.as_mut().map(|field| field as _)
557 }
558 pub fn merkle_proof_mut(&mut self) -> &mut super::MerkleProof {
561 self.merkle_proof.get_or_insert_default()
562 }
563 pub fn merkle_proof_opt(&self) -> Option<&super::MerkleProof> {
565 self.merkle_proof.as_ref().map(|field| field as _)
566 }
567 pub fn set_merkle_proof<T: Into<super::MerkleProof>>(&mut self, field: T) {
569 self.merkle_proof = Some(field.into().into());
570 }
571 pub fn with_merkle_proof<T: Into<super::MerkleProof>>(
573 mut self,
574 field: T,
575 ) -> Self {
576 self.set_merkle_proof(field.into());
577 self
578 }
579 pub fn leaf_index_opt_mut(&mut self) -> Option<&mut u64> {
581 self.leaf_index.as_mut().map(|field| field as _)
582 }
583 pub fn leaf_index_mut(&mut self) -> &mut u64 {
586 self.leaf_index.get_or_insert_default()
587 }
588 pub fn leaf_index_opt(&self) -> Option<u64> {
590 self.leaf_index.as_ref().map(|field| *field)
591 }
592 pub fn set_leaf_index(&mut self, field: u64) {
594 self.leaf_index = Some(field);
595 }
596 pub fn with_leaf_index(mut self, field: u64) -> Self {
598 self.set_leaf_index(field);
599 self
600 }
601 pub fn tree_root_opt(&self) -> Option<&[u8]> {
603 self.tree_root.as_ref().map(|field| field as _)
604 }
605 pub fn set_tree_root<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
607 self.tree_root = Some(field.into().into());
608 }
609 pub fn with_tree_root<T: Into<::prost::bytes::Bytes>>(
611 mut self,
612 field: T,
613 ) -> Self {
614 self.set_tree_root(field.into());
615 self
616 }
617 pub fn object_data_opt(&self) -> Option<&[u8]> {
619 self.object_data.as_ref().map(|field| field as _)
620 }
621 pub fn set_object_data<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
623 self.object_data = Some(field.into().into());
624 }
625 pub fn with_object_data<T: Into<::prost::bytes::Bytes>>(
627 mut self,
628 field: T,
629 ) -> Self {
630 self.set_object_data(field.into());
631 self
632 }
633 }
634 impl super::OcsNonInclusionProof {
635 pub const fn const_default() -> Self {
636 Self {
637 non_inclusion_proof: None,
638 tree_root: None,
639 }
640 }
641 #[doc(hidden)]
642 pub fn default_instance() -> &'static Self {
643 static DEFAULT: super::OcsNonInclusionProof = super::OcsNonInclusionProof::const_default();
644 &DEFAULT
645 }
646 pub fn non_inclusion_proof(&self) -> &super::MerkleNonInclusionProof {
648 self.non_inclusion_proof
649 .as_ref()
650 .map(|field| field as _)
651 .unwrap_or_else(|| {
652 super::MerkleNonInclusionProof::default_instance() as _
653 })
654 }
655 pub fn non_inclusion_proof_opt_mut(
657 &mut self,
658 ) -> Option<&mut super::MerkleNonInclusionProof> {
659 self.non_inclusion_proof.as_mut().map(|field| field as _)
660 }
661 pub fn non_inclusion_proof_mut(
664 &mut self,
665 ) -> &mut super::MerkleNonInclusionProof {
666 self.non_inclusion_proof.get_or_insert_default()
667 }
668 pub fn non_inclusion_proof_opt(
670 &self,
671 ) -> Option<&super::MerkleNonInclusionProof> {
672 self.non_inclusion_proof.as_ref().map(|field| field as _)
673 }
674 pub fn set_non_inclusion_proof<T: Into<super::MerkleNonInclusionProof>>(
676 &mut self,
677 field: T,
678 ) {
679 self.non_inclusion_proof = Some(field.into().into());
680 }
681 pub fn with_non_inclusion_proof<T: Into<super::MerkleNonInclusionProof>>(
683 mut self,
684 field: T,
685 ) -> Self {
686 self.set_non_inclusion_proof(field.into());
687 self
688 }
689 pub fn tree_root_opt(&self) -> Option<&[u8]> {
691 self.tree_root.as_ref().map(|field| field as _)
692 }
693 pub fn set_tree_root<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
695 self.tree_root = Some(field.into().into());
696 }
697 pub fn with_tree_root<T: Into<::prost::bytes::Bytes>>(
699 mut self,
700 field: T,
701 ) -> Self {
702 self.set_tree_root(field.into());
703 self
704 }
705 }
706}