Skip to main content

sui_rpc/proto/generated/
sui.rpc.v2alpha.accessors.rs

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        ///If `object_id` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
16        pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
17            self.object_id.as_mut().map(|field| field as _)
18        }
19        ///Returns a mutable reference to `object_id`.
20        ///If the field is unset, it is first initialized with the default value.
21        pub fn object_id_mut(&mut self) -> &mut String {
22            self.object_id.get_or_insert_default()
23        }
24        ///If `object_id` is set, returns [`Some`] with the value; otherwise returns [`None`].
25        pub fn object_id_opt(&self) -> Option<&str> {
26            self.object_id.as_ref().map(|field| field as _)
27        }
28        ///Sets `object_id` with the provided value.
29        pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
30            self.object_id = Some(field.into().into());
31        }
32        ///Sets `object_id` with the provided value.
33        pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
34            self.set_object_id(field.into());
35            self
36        }
37        ///If `checkpoint` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
38        pub fn checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
39            self.checkpoint.as_mut().map(|field| field as _)
40        }
41        ///Returns a mutable reference to `checkpoint`.
42        ///If the field is unset, it is first initialized with the default value.
43        pub fn checkpoint_mut(&mut self) -> &mut u64 {
44            self.checkpoint.get_or_insert_default()
45        }
46        ///If `checkpoint` is set, returns [`Some`] with the value; otherwise returns [`None`].
47        pub fn checkpoint_opt(&self) -> Option<u64> {
48            self.checkpoint.as_ref().map(|field| *field)
49        }
50        ///Sets `checkpoint` with the provided value.
51        pub fn set_checkpoint(&mut self, field: u64) {
52            self.checkpoint = Some(field);
53        }
54        ///Sets `checkpoint` with the provided value.
55        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        ///If `checkpoint_summary` is set, returns [`Some`] with the value; otherwise returns [`None`].
73        pub fn checkpoint_summary_opt(&self) -> Option<&[u8]> {
74            self.checkpoint_summary.as_ref().map(|field| field as _)
75        }
76        ///Sets `checkpoint_summary` with the provided value.
77        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        ///Sets `checkpoint_summary` with the provided value.
84        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        ///Returns the value of `inclusion`, or the default value if `inclusion` is unset.
92        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        ///If `inclusion` is set, returns [`Some`] with the value; otherwise returns [`None`].
103        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        ///If `inclusion` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
114        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        ///Returns a mutable reference to `inclusion`.
125        ///If the field is unset, it is first initialized with the default value.
126        ///If any other oneof field in the same oneof is set, it will be cleared.
127        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        ///Sets `inclusion` with the provided value.
138        ///If any other oneof field in the same oneof is set, it will be cleared.
139        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        ///Sets `inclusion` with the provided value.
147        ///If any other oneof field in the same oneof is set, it will be cleared.
148        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        ///Returns the value of `non_inclusion`, or the default value if `non_inclusion` is unset.
156        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        ///If `non_inclusion` is set, returns [`Some`] with the value; otherwise returns [`None`].
167        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        ///If `non_inclusion` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
178        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        ///Returns a mutable reference to `non_inclusion`.
191        ///If the field is unset, it is first initialized with the default value.
192        ///If any other oneof field in the same oneof is set, it will be cleared.
193        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        ///Sets `non_inclusion` with the provided value.
204        ///If any other oneof field in the same oneof is set, it will be cleared.
205        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        ///Sets `non_inclusion` with the provided value.
216        ///If any other oneof field in the same oneof is set, it will be cleared.
217        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        ///Returns the value of `leaf`, or the default value if `leaf` is unset.
238        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        ///If `leaf` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
247        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        ///Returns a mutable reference to `leaf`.
253        ///If the field is unset, it is first initialized with the default value.
254        pub fn leaf_mut(&mut self) -> &mut super::super::v2::ObjectReference {
255            self.leaf.get_or_insert_default()
256        }
257        ///If `leaf` is set, returns [`Some`] with the value; otherwise returns [`None`].
258        pub fn leaf_opt(&self) -> Option<&super::super::v2::ObjectReference> {
259            self.leaf.as_ref().map(|field| field as _)
260        }
261        ///Sets `leaf` with the provided value.
262        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        ///Sets `leaf` with the provided value.
269        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        ///Returns the value of `merkle_proof`, or the default value if `merkle_proof` is unset.
277        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        ///If `merkle_proof` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
284        pub fn merkle_proof_opt_mut(&mut self) -> Option<&mut super::MerkleProof> {
285            self.merkle_proof.as_mut().map(|field| field as _)
286        }
287        ///Returns a mutable reference to `merkle_proof`.
288        ///If the field is unset, it is first initialized with the default value.
289        pub fn merkle_proof_mut(&mut self) -> &mut super::MerkleProof {
290            self.merkle_proof.get_or_insert_default()
291        }
292        ///If `merkle_proof` is set, returns [`Some`] with the value; otherwise returns [`None`].
293        pub fn merkle_proof_opt(&self) -> Option<&super::MerkleProof> {
294            self.merkle_proof.as_ref().map(|field| field as _)
295        }
296        ///Sets `merkle_proof` with the provided value.
297        pub fn set_merkle_proof<T: Into<super::MerkleProof>>(&mut self, field: T) {
298            self.merkle_proof = Some(field.into().into());
299        }
300        ///Sets `merkle_proof` with the provided value.
301        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        ///Returns the value of `digest`, or the default value if `digest` is unset.
319        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        ///If `digest` is set, returns [`Some`] with the value; otherwise returns [`None`].
327        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        ///If `digest` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
335        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        ///Returns a mutable reference to `digest`.
343        ///If the field is unset, it is first initialized with the default value.
344        ///If any other oneof field in the same oneof is set, it will be cleared.
345        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        ///Sets `digest` with the provided value.
354        ///If any other oneof field in the same oneof is set, it will be cleared.
355        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        ///Sets `digest` with the provided value.
359        ///If any other oneof field in the same oneof is set, it will be cleared.
360        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        ///If `index` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
379        pub fn index_opt_mut(&mut self) -> Option<&mut u64> {
380            self.index.as_mut().map(|field| field as _)
381        }
382        ///Returns a mutable reference to `index`.
383        ///If the field is unset, it is first initialized with the default value.
384        pub fn index_mut(&mut self) -> &mut u64 {
385            self.index.get_or_insert_default()
386        }
387        ///If `index` is set, returns [`Some`] with the value; otherwise returns [`None`].
388        pub fn index_opt(&self) -> Option<u64> {
389            self.index.as_ref().map(|field| *field)
390        }
391        ///Sets `index` with the provided value.
392        pub fn set_index(&mut self, field: u64) {
393            self.index = Some(field);
394        }
395        ///Sets `index` with the provided value.
396        pub fn with_index(mut self, field: u64) -> Self {
397            self.set_index(field);
398            self
399        }
400        ///Returns the value of `left_leaf`, or the default value if `left_leaf` is unset.
401        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        ///If `left_leaf` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
408        pub fn left_leaf_opt_mut(&mut self) -> Option<&mut super::MerkleNeighbourLeaf> {
409            self.left_leaf.as_mut().map(|field| field as _)
410        }
411        ///Returns a mutable reference to `left_leaf`.
412        ///If the field is unset, it is first initialized with the default value.
413        pub fn left_leaf_mut(&mut self) -> &mut super::MerkleNeighbourLeaf {
414            self.left_leaf.get_or_insert_default()
415        }
416        ///If `left_leaf` is set, returns [`Some`] with the value; otherwise returns [`None`].
417        pub fn left_leaf_opt(&self) -> Option<&super::MerkleNeighbourLeaf> {
418            self.left_leaf.as_ref().map(|field| field as _)
419        }
420        ///Sets `left_leaf` with the provided value.
421        pub fn set_left_leaf<T: Into<super::MerkleNeighbourLeaf>>(&mut self, field: T) {
422            self.left_leaf = Some(field.into().into());
423        }
424        ///Sets `left_leaf` with the provided value.
425        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        ///Returns the value of `right_leaf`, or the default value if `right_leaf` is unset.
433        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        ///If `right_leaf` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
440        pub fn right_leaf_opt_mut(&mut self) -> Option<&mut super::MerkleNeighbourLeaf> {
441            self.right_leaf.as_mut().map(|field| field as _)
442        }
443        ///Returns a mutable reference to `right_leaf`.
444        ///If the field is unset, it is first initialized with the default value.
445        pub fn right_leaf_mut(&mut self) -> &mut super::MerkleNeighbourLeaf {
446            self.right_leaf.get_or_insert_default()
447        }
448        ///If `right_leaf` is set, returns [`Some`] with the value; otherwise returns [`None`].
449        pub fn right_leaf_opt(&self) -> Option<&super::MerkleNeighbourLeaf> {
450            self.right_leaf.as_ref().map(|field| field as _)
451        }
452        ///Sets `right_leaf` with the provided value.
453        pub fn set_right_leaf<T: Into<super::MerkleNeighbourLeaf>>(&mut self, field: T) {
454            self.right_leaf = Some(field.into().into());
455        }
456        ///Sets `right_leaf` with the provided value.
457        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        ///Returns the value of `path`, or the default value if `path` is unset.
475        pub fn path(&self) -> &[super::MerkleNode] {
476            &self.path
477        }
478        ///Returns a mutable reference to `path`.
479        ///If the field is unset, it is first initialized with the default value.
480        pub fn path_mut(&mut self) -> &mut Vec<super::MerkleNode> {
481            &mut self.path
482        }
483        ///Sets `path` with the provided value.
484        pub fn set_path(&mut self, field: Vec<super::MerkleNode>) {
485            self.path = field;
486        }
487        ///Sets `path` with the provided value.
488        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        ///Returns the value of `object_ref`, or the default value if `object_ref` is unset.
509        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        ///If `object_ref` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
518        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        ///Returns a mutable reference to `object_ref`.
524        ///If the field is unset, it is first initialized with the default value.
525        pub fn object_ref_mut(&mut self) -> &mut super::super::v2::ObjectReference {
526            self.object_ref.get_or_insert_default()
527        }
528        ///If `object_ref` is set, returns [`Some`] with the value; otherwise returns [`None`].
529        pub fn object_ref_opt(&self) -> Option<&super::super::v2::ObjectReference> {
530            self.object_ref.as_ref().map(|field| field as _)
531        }
532        ///Sets `object_ref` with the provided value.
533        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        ///Sets `object_ref` with the provided value.
540        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        ///Returns the value of `merkle_proof`, or the default value if `merkle_proof` is unset.
548        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        ///If `merkle_proof` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
555        pub fn merkle_proof_opt_mut(&mut self) -> Option<&mut super::MerkleProof> {
556            self.merkle_proof.as_mut().map(|field| field as _)
557        }
558        ///Returns a mutable reference to `merkle_proof`.
559        ///If the field is unset, it is first initialized with the default value.
560        pub fn merkle_proof_mut(&mut self) -> &mut super::MerkleProof {
561            self.merkle_proof.get_or_insert_default()
562        }
563        ///If `merkle_proof` is set, returns [`Some`] with the value; otherwise returns [`None`].
564        pub fn merkle_proof_opt(&self) -> Option<&super::MerkleProof> {
565            self.merkle_proof.as_ref().map(|field| field as _)
566        }
567        ///Sets `merkle_proof` with the provided value.
568        pub fn set_merkle_proof<T: Into<super::MerkleProof>>(&mut self, field: T) {
569            self.merkle_proof = Some(field.into().into());
570        }
571        ///Sets `merkle_proof` with the provided value.
572        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        ///If `leaf_index` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
580        pub fn leaf_index_opt_mut(&mut self) -> Option<&mut u64> {
581            self.leaf_index.as_mut().map(|field| field as _)
582        }
583        ///Returns a mutable reference to `leaf_index`.
584        ///If the field is unset, it is first initialized with the default value.
585        pub fn leaf_index_mut(&mut self) -> &mut u64 {
586            self.leaf_index.get_or_insert_default()
587        }
588        ///If `leaf_index` is set, returns [`Some`] with the value; otherwise returns [`None`].
589        pub fn leaf_index_opt(&self) -> Option<u64> {
590            self.leaf_index.as_ref().map(|field| *field)
591        }
592        ///Sets `leaf_index` with the provided value.
593        pub fn set_leaf_index(&mut self, field: u64) {
594            self.leaf_index = Some(field);
595        }
596        ///Sets `leaf_index` with the provided value.
597        pub fn with_leaf_index(mut self, field: u64) -> Self {
598            self.set_leaf_index(field);
599            self
600        }
601        ///If `tree_root` is set, returns [`Some`] with the value; otherwise returns [`None`].
602        pub fn tree_root_opt(&self) -> Option<&[u8]> {
603            self.tree_root.as_ref().map(|field| field as _)
604        }
605        ///Sets `tree_root` with the provided value.
606        pub fn set_tree_root<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
607            self.tree_root = Some(field.into().into());
608        }
609        ///Sets `tree_root` with the provided value.
610        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        ///If `object_data` is set, returns [`Some`] with the value; otherwise returns [`None`].
618        pub fn object_data_opt(&self) -> Option<&[u8]> {
619            self.object_data.as_ref().map(|field| field as _)
620        }
621        ///Sets `object_data` with the provided value.
622        pub fn set_object_data<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
623            self.object_data = Some(field.into().into());
624        }
625        ///Sets `object_data` with the provided value.
626        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        ///Returns the value of `non_inclusion_proof`, or the default value if `non_inclusion_proof` is unset.
647        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        ///If `non_inclusion_proof` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
656        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        ///Returns a mutable reference to `non_inclusion_proof`.
662        ///If the field is unset, it is first initialized with the default value.
663        pub fn non_inclusion_proof_mut(
664            &mut self,
665        ) -> &mut super::MerkleNonInclusionProof {
666            self.non_inclusion_proof.get_or_insert_default()
667        }
668        ///If `non_inclusion_proof` is set, returns [`Some`] with the value; otherwise returns [`None`].
669        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        ///Sets `non_inclusion_proof` with the provided value.
675        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        ///Sets `non_inclusion_proof` with the provided value.
682        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        ///If `tree_root` is set, returns [`Some`] with the value; otherwise returns [`None`].
690        pub fn tree_root_opt(&self) -> Option<&[u8]> {
691            self.tree_root.as_ref().map(|field| field as _)
692        }
693        ///Sets `tree_root` with the provided value.
694        pub fn set_tree_root<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
695            self.tree_root = Some(field.into().into());
696        }
697        ///Sets `tree_root` with the provided value.
698        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}