1mod _accessor_impls {
2 #![allow(clippy::useless_conversion)]
3 impl super::ActiveJwk {
4 pub const fn const_default() -> Self {
5 Self {
6 id: None,
7 jwk: None,
8 epoch: None,
9 }
10 }
11 #[doc(hidden)]
12 pub fn default_instance() -> &'static Self {
13 static DEFAULT: super::ActiveJwk = super::ActiveJwk::const_default();
14 &DEFAULT
15 }
16 pub fn id(&self) -> &super::JwkId {
18 self.id
19 .as_ref()
20 .map(|field| field as _)
21 .unwrap_or_else(|| super::JwkId::default_instance() as _)
22 }
23 pub fn id_opt_mut(&mut self) -> Option<&mut super::JwkId> {
25 self.id.as_mut().map(|field| field as _)
26 }
27 pub fn id_mut(&mut self) -> &mut super::JwkId {
30 self.id.get_or_insert_default()
31 }
32 pub fn id_opt(&self) -> Option<&super::JwkId> {
34 self.id.as_ref().map(|field| field as _)
35 }
36 pub fn set_id<T: Into<super::JwkId>>(&mut self, field: T) {
38 self.id = Some(field.into().into());
39 }
40 pub fn with_id<T: Into<super::JwkId>>(mut self, field: T) -> Self {
42 self.set_id(field.into());
43 self
44 }
45 pub fn jwk(&self) -> &super::Jwk {
47 self.jwk
48 .as_ref()
49 .map(|field| field as _)
50 .unwrap_or_else(|| super::Jwk::default_instance() as _)
51 }
52 pub fn jwk_opt_mut(&mut self) -> Option<&mut super::Jwk> {
54 self.jwk.as_mut().map(|field| field as _)
55 }
56 pub fn jwk_mut(&mut self) -> &mut super::Jwk {
59 self.jwk.get_or_insert_default()
60 }
61 pub fn jwk_opt(&self) -> Option<&super::Jwk> {
63 self.jwk.as_ref().map(|field| field as _)
64 }
65 pub fn set_jwk<T: Into<super::Jwk>>(&mut self, field: T) {
67 self.jwk = Some(field.into().into());
68 }
69 pub fn with_jwk<T: Into<super::Jwk>>(mut self, field: T) -> Self {
71 self.set_jwk(field.into());
72 self
73 }
74 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
76 self.epoch.as_mut().map(|field| field as _)
77 }
78 pub fn epoch_mut(&mut self) -> &mut u64 {
81 self.epoch.get_or_insert_default()
82 }
83 pub fn epoch_opt(&self) -> Option<u64> {
85 self.epoch.as_ref().map(|field| *field)
86 }
87 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
89 self.epoch = Some(field.into().into());
90 }
91 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
93 self.set_epoch(field.into());
94 self
95 }
96 }
97 impl super::Argument {
98 pub const fn const_default() -> Self {
99 Self {
100 kind: None,
101 input: None,
102 result: None,
103 subresult: None,
104 }
105 }
106 #[doc(hidden)]
107 pub fn default_instance() -> &'static Self {
108 static DEFAULT: super::Argument = super::Argument::const_default();
109 &DEFAULT
110 }
111 pub fn with_kind<T: Into<super::argument::ArgumentKind>>(
113 mut self,
114 field: T,
115 ) -> Self {
116 self.set_kind(field.into());
117 self
118 }
119 pub fn input_opt_mut(&mut self) -> Option<&mut u32> {
121 self.input.as_mut().map(|field| field as _)
122 }
123 pub fn input_mut(&mut self) -> &mut u32 {
126 self.input.get_or_insert_default()
127 }
128 pub fn input_opt(&self) -> Option<u32> {
130 self.input.as_ref().map(|field| *field)
131 }
132 pub fn set_input<T: Into<u32>>(&mut self, field: T) {
134 self.input = Some(field.into().into());
135 }
136 pub fn with_input<T: Into<u32>>(mut self, field: T) -> Self {
138 self.set_input(field.into());
139 self
140 }
141 pub fn result_opt_mut(&mut self) -> Option<&mut u32> {
143 self.result.as_mut().map(|field| field as _)
144 }
145 pub fn result_mut(&mut self) -> &mut u32 {
148 self.result.get_or_insert_default()
149 }
150 pub fn result_opt(&self) -> Option<u32> {
152 self.result.as_ref().map(|field| *field)
153 }
154 pub fn set_result<T: Into<u32>>(&mut self, field: T) {
156 self.result = Some(field.into().into());
157 }
158 pub fn with_result<T: Into<u32>>(mut self, field: T) -> Self {
160 self.set_result(field.into());
161 self
162 }
163 pub fn subresult_opt_mut(&mut self) -> Option<&mut u32> {
165 self.subresult.as_mut().map(|field| field as _)
166 }
167 pub fn subresult_mut(&mut self) -> &mut u32 {
170 self.subresult.get_or_insert_default()
171 }
172 pub fn subresult_opt(&self) -> Option<u32> {
174 self.subresult.as_ref().map(|field| *field)
175 }
176 pub fn set_subresult<T: Into<u32>>(&mut self, field: T) {
178 self.subresult = Some(field.into().into());
179 }
180 pub fn with_subresult<T: Into<u32>>(mut self, field: T) -> Self {
182 self.set_subresult(field.into());
183 self
184 }
185 }
186 impl super::AuthenticatorStateExpire {
187 pub const fn const_default() -> Self {
188 Self {
189 min_epoch: None,
190 authenticator_object_initial_shared_version: None,
191 }
192 }
193 #[doc(hidden)]
194 pub fn default_instance() -> &'static Self {
195 static DEFAULT: super::AuthenticatorStateExpire = super::AuthenticatorStateExpire::const_default();
196 &DEFAULT
197 }
198 pub fn min_epoch_opt_mut(&mut self) -> Option<&mut u64> {
200 self.min_epoch.as_mut().map(|field| field as _)
201 }
202 pub fn min_epoch_mut(&mut self) -> &mut u64 {
205 self.min_epoch.get_or_insert_default()
206 }
207 pub fn min_epoch_opt(&self) -> Option<u64> {
209 self.min_epoch.as_ref().map(|field| *field)
210 }
211 pub fn set_min_epoch<T: Into<u64>>(&mut self, field: T) {
213 self.min_epoch = Some(field.into().into());
214 }
215 pub fn with_min_epoch<T: Into<u64>>(mut self, field: T) -> Self {
217 self.set_min_epoch(field.into());
218 self
219 }
220 pub fn authenticator_object_initial_shared_version_opt_mut(
222 &mut self,
223 ) -> Option<&mut u64> {
224 self.authenticator_object_initial_shared_version
225 .as_mut()
226 .map(|field| field as _)
227 }
228 pub fn authenticator_object_initial_shared_version_mut(&mut self) -> &mut u64 {
231 self.authenticator_object_initial_shared_version.get_or_insert_default()
232 }
233 pub fn authenticator_object_initial_shared_version_opt(&self) -> Option<u64> {
235 self.authenticator_object_initial_shared_version.as_ref().map(|field| *field)
236 }
237 pub fn set_authenticator_object_initial_shared_version<T: Into<u64>>(
239 &mut self,
240 field: T,
241 ) {
242 self.authenticator_object_initial_shared_version = Some(field.into().into());
243 }
244 pub fn with_authenticator_object_initial_shared_version<T: Into<u64>>(
246 mut self,
247 field: T,
248 ) -> Self {
249 self.set_authenticator_object_initial_shared_version(field.into());
250 self
251 }
252 }
253 impl super::AuthenticatorStateUpdate {
254 pub const fn const_default() -> Self {
255 Self {
256 epoch: None,
257 round: None,
258 new_active_jwks: Vec::new(),
259 authenticator_object_initial_shared_version: None,
260 }
261 }
262 #[doc(hidden)]
263 pub fn default_instance() -> &'static Self {
264 static DEFAULT: super::AuthenticatorStateUpdate = super::AuthenticatorStateUpdate::const_default();
265 &DEFAULT
266 }
267 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
269 self.epoch.as_mut().map(|field| field as _)
270 }
271 pub fn epoch_mut(&mut self) -> &mut u64 {
274 self.epoch.get_or_insert_default()
275 }
276 pub fn epoch_opt(&self) -> Option<u64> {
278 self.epoch.as_ref().map(|field| *field)
279 }
280 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
282 self.epoch = Some(field.into().into());
283 }
284 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
286 self.set_epoch(field.into());
287 self
288 }
289 pub fn round_opt_mut(&mut self) -> Option<&mut u64> {
291 self.round.as_mut().map(|field| field as _)
292 }
293 pub fn round_mut(&mut self) -> &mut u64 {
296 self.round.get_or_insert_default()
297 }
298 pub fn round_opt(&self) -> Option<u64> {
300 self.round.as_ref().map(|field| *field)
301 }
302 pub fn set_round<T: Into<u64>>(&mut self, field: T) {
304 self.round = Some(field.into().into());
305 }
306 pub fn with_round<T: Into<u64>>(mut self, field: T) -> Self {
308 self.set_round(field.into());
309 self
310 }
311 pub fn new_active_jwks(&self) -> &[super::ActiveJwk] {
313 &self.new_active_jwks
314 }
315 pub fn new_active_jwks_mut(&mut self) -> &mut Vec<super::ActiveJwk> {
318 &mut self.new_active_jwks
319 }
320 pub fn set_new_active_jwks(&mut self, field: Vec<super::ActiveJwk>) {
322 self.new_active_jwks = field;
323 }
324 pub fn with_new_active_jwks(mut self, field: Vec<super::ActiveJwk>) -> Self {
326 self.set_new_active_jwks(field);
327 self
328 }
329 pub fn authenticator_object_initial_shared_version_opt_mut(
331 &mut self,
332 ) -> Option<&mut u64> {
333 self.authenticator_object_initial_shared_version
334 .as_mut()
335 .map(|field| field as _)
336 }
337 pub fn authenticator_object_initial_shared_version_mut(&mut self) -> &mut u64 {
340 self.authenticator_object_initial_shared_version.get_or_insert_default()
341 }
342 pub fn authenticator_object_initial_shared_version_opt(&self) -> Option<u64> {
344 self.authenticator_object_initial_shared_version.as_ref().map(|field| *field)
345 }
346 pub fn set_authenticator_object_initial_shared_version<T: Into<u64>>(
348 &mut self,
349 field: T,
350 ) {
351 self.authenticator_object_initial_shared_version = Some(field.into().into());
352 }
353 pub fn with_authenticator_object_initial_shared_version<T: Into<u64>>(
355 mut self,
356 field: T,
357 ) -> Self {
358 self.set_authenticator_object_initial_shared_version(field.into());
359 self
360 }
361 }
362 impl super::Balance {
363 pub const fn const_default() -> Self {
364 Self {
365 coin_type: None,
366 balance: None,
367 }
368 }
369 #[doc(hidden)]
370 pub fn default_instance() -> &'static Self {
371 static DEFAULT: super::Balance = super::Balance::const_default();
372 &DEFAULT
373 }
374 pub fn coin_type_opt_mut(&mut self) -> Option<&mut String> {
376 self.coin_type.as_mut().map(|field| field as _)
377 }
378 pub fn coin_type_mut(&mut self) -> &mut String {
381 self.coin_type.get_or_insert_default()
382 }
383 pub fn coin_type_opt(&self) -> Option<&str> {
385 self.coin_type.as_ref().map(|field| field as _)
386 }
387 pub fn set_coin_type<T: Into<String>>(&mut self, field: T) {
389 self.coin_type = Some(field.into().into());
390 }
391 pub fn with_coin_type<T: Into<String>>(mut self, field: T) -> Self {
393 self.set_coin_type(field.into());
394 self
395 }
396 pub fn balance_opt_mut(&mut self) -> Option<&mut u64> {
398 self.balance.as_mut().map(|field| field as _)
399 }
400 pub fn balance_mut(&mut self) -> &mut u64 {
403 self.balance.get_or_insert_default()
404 }
405 pub fn balance_opt(&self) -> Option<u64> {
407 self.balance.as_ref().map(|field| *field)
408 }
409 pub fn set_balance<T: Into<u64>>(&mut self, field: T) {
411 self.balance = Some(field.into().into());
412 }
413 pub fn with_balance<T: Into<u64>>(mut self, field: T) -> Self {
415 self.set_balance(field.into());
416 self
417 }
418 }
419 impl super::BalanceChange {
420 pub const fn const_default() -> Self {
421 Self {
422 address: None,
423 coin_type: None,
424 amount: None,
425 }
426 }
427 #[doc(hidden)]
428 pub fn default_instance() -> &'static Self {
429 static DEFAULT: super::BalanceChange = super::BalanceChange::const_default();
430 &DEFAULT
431 }
432 pub fn address_opt_mut(&mut self) -> Option<&mut String> {
434 self.address.as_mut().map(|field| field as _)
435 }
436 pub fn address_mut(&mut self) -> &mut String {
439 self.address.get_or_insert_default()
440 }
441 pub fn address_opt(&self) -> Option<&str> {
443 self.address.as_ref().map(|field| field as _)
444 }
445 pub fn set_address<T: Into<String>>(&mut self, field: T) {
447 self.address = Some(field.into().into());
448 }
449 pub fn with_address<T: Into<String>>(mut self, field: T) -> Self {
451 self.set_address(field.into());
452 self
453 }
454 pub fn coin_type_opt_mut(&mut self) -> Option<&mut String> {
456 self.coin_type.as_mut().map(|field| field as _)
457 }
458 pub fn coin_type_mut(&mut self) -> &mut String {
461 self.coin_type.get_or_insert_default()
462 }
463 pub fn coin_type_opt(&self) -> Option<&str> {
465 self.coin_type.as_ref().map(|field| field as _)
466 }
467 pub fn set_coin_type<T: Into<String>>(&mut self, field: T) {
469 self.coin_type = Some(field.into().into());
470 }
471 pub fn with_coin_type<T: Into<String>>(mut self, field: T) -> Self {
473 self.set_coin_type(field.into());
474 self
475 }
476 pub fn amount_opt_mut(&mut self) -> Option<&mut String> {
478 self.amount.as_mut().map(|field| field as _)
479 }
480 pub fn amount_mut(&mut self) -> &mut String {
483 self.amount.get_or_insert_default()
484 }
485 pub fn amount_opt(&self) -> Option<&str> {
487 self.amount.as_ref().map(|field| field as _)
488 }
489 pub fn set_amount<T: Into<String>>(&mut self, field: T) {
491 self.amount = Some(field.into().into());
492 }
493 pub fn with_amount<T: Into<String>>(mut self, field: T) -> Self {
495 self.set_amount(field.into());
496 self
497 }
498 }
499 impl super::BatchGetObjectsRequest {
500 pub const fn const_default() -> Self {
501 Self {
502 requests: Vec::new(),
503 read_mask: None,
504 }
505 }
506 #[doc(hidden)]
507 pub fn default_instance() -> &'static Self {
508 static DEFAULT: super::BatchGetObjectsRequest = super::BatchGetObjectsRequest::const_default();
509 &DEFAULT
510 }
511 pub fn requests(&self) -> &[super::GetObjectRequest] {
513 &self.requests
514 }
515 pub fn requests_mut(&mut self) -> &mut Vec<super::GetObjectRequest> {
518 &mut self.requests
519 }
520 pub fn set_requests(&mut self, field: Vec<super::GetObjectRequest>) {
522 self.requests = field;
523 }
524 pub fn with_requests(mut self, field: Vec<super::GetObjectRequest>) -> Self {
526 self.set_requests(field);
527 self
528 }
529 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
531 self.read_mask.as_mut().map(|field| field as _)
532 }
533 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
536 self.read_mask.get_or_insert_default()
537 }
538 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
540 self.read_mask.as_ref().map(|field| field as _)
541 }
542 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
544 self.read_mask = Some(field.into().into());
545 }
546 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
548 mut self,
549 field: T,
550 ) -> Self {
551 self.set_read_mask(field.into());
552 self
553 }
554 }
555 impl super::BatchGetObjectsResponse {
556 pub const fn const_default() -> Self {
557 Self { objects: Vec::new() }
558 }
559 #[doc(hidden)]
560 pub fn default_instance() -> &'static Self {
561 static DEFAULT: super::BatchGetObjectsResponse = super::BatchGetObjectsResponse::const_default();
562 &DEFAULT
563 }
564 pub fn objects(&self) -> &[super::GetObjectResult] {
566 &self.objects
567 }
568 pub fn objects_mut(&mut self) -> &mut Vec<super::GetObjectResult> {
571 &mut self.objects
572 }
573 pub fn set_objects(&mut self, field: Vec<super::GetObjectResult>) {
575 self.objects = field;
576 }
577 pub fn with_objects(mut self, field: Vec<super::GetObjectResult>) -> Self {
579 self.set_objects(field);
580 self
581 }
582 }
583 impl super::BatchGetTransactionsRequest {
584 pub const fn const_default() -> Self {
585 Self {
586 digests: Vec::new(),
587 read_mask: None,
588 }
589 }
590 #[doc(hidden)]
591 pub fn default_instance() -> &'static Self {
592 static DEFAULT: super::BatchGetTransactionsRequest = super::BatchGetTransactionsRequest::const_default();
593 &DEFAULT
594 }
595 pub fn digests(&self) -> &[String] {
597 &self.digests
598 }
599 pub fn digests_mut(&mut self) -> &mut Vec<String> {
602 &mut self.digests
603 }
604 pub fn set_digests(&mut self, field: Vec<String>) {
606 self.digests = field;
607 }
608 pub fn with_digests(mut self, field: Vec<String>) -> Self {
610 self.set_digests(field);
611 self
612 }
613 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
615 self.read_mask.as_mut().map(|field| field as _)
616 }
617 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
620 self.read_mask.get_or_insert_default()
621 }
622 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
624 self.read_mask.as_ref().map(|field| field as _)
625 }
626 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
628 self.read_mask = Some(field.into().into());
629 }
630 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
632 mut self,
633 field: T,
634 ) -> Self {
635 self.set_read_mask(field.into());
636 self
637 }
638 }
639 impl super::BatchGetTransactionsResponse {
640 pub const fn const_default() -> Self {
641 Self { transactions: Vec::new() }
642 }
643 #[doc(hidden)]
644 pub fn default_instance() -> &'static Self {
645 static DEFAULT: super::BatchGetTransactionsResponse = super::BatchGetTransactionsResponse::const_default();
646 &DEFAULT
647 }
648 pub fn transactions(&self) -> &[super::GetTransactionResult] {
650 &self.transactions
651 }
652 pub fn transactions_mut(&mut self) -> &mut Vec<super::GetTransactionResult> {
655 &mut self.transactions
656 }
657 pub fn set_transactions(&mut self, field: Vec<super::GetTransactionResult>) {
659 self.transactions = field;
660 }
661 pub fn with_transactions(
663 mut self,
664 field: Vec<super::GetTransactionResult>,
665 ) -> Self {
666 self.set_transactions(field);
667 self
668 }
669 }
670 impl super::Bcs {
671 pub const fn const_default() -> Self {
672 Self { name: None, value: None }
673 }
674 #[doc(hidden)]
675 pub fn default_instance() -> &'static Self {
676 static DEFAULT: super::Bcs = super::Bcs::const_default();
677 &DEFAULT
678 }
679 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
681 self.name.as_mut().map(|field| field as _)
682 }
683 pub fn name_mut(&mut self) -> &mut String {
686 self.name.get_or_insert_default()
687 }
688 pub fn name_opt(&self) -> Option<&str> {
690 self.name.as_ref().map(|field| field as _)
691 }
692 pub fn set_name<T: Into<String>>(&mut self, field: T) {
694 self.name = Some(field.into().into());
695 }
696 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
698 self.set_name(field.into());
699 self
700 }
701 pub fn value_opt(&self) -> Option<&[u8]> {
703 self.value.as_ref().map(|field| field as _)
704 }
705 pub fn set_value<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
707 self.value = Some(field.into().into());
708 }
709 pub fn with_value<T: Into<::prost::bytes::Bytes>>(mut self, field: T) -> Self {
711 self.set_value(field.into());
712 self
713 }
714 }
715 impl super::CanceledTransaction {
716 pub const fn const_default() -> Self {
717 Self {
718 digest: None,
719 version_assignments: Vec::new(),
720 }
721 }
722 #[doc(hidden)]
723 pub fn default_instance() -> &'static Self {
724 static DEFAULT: super::CanceledTransaction = super::CanceledTransaction::const_default();
725 &DEFAULT
726 }
727 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
729 self.digest.as_mut().map(|field| field as _)
730 }
731 pub fn digest_mut(&mut self) -> &mut String {
734 self.digest.get_or_insert_default()
735 }
736 pub fn digest_opt(&self) -> Option<&str> {
738 self.digest.as_ref().map(|field| field as _)
739 }
740 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
742 self.digest = Some(field.into().into());
743 }
744 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
746 self.set_digest(field.into());
747 self
748 }
749 pub fn version_assignments(&self) -> &[super::VersionAssignment] {
751 &self.version_assignments
752 }
753 pub fn version_assignments_mut(&mut self) -> &mut Vec<super::VersionAssignment> {
756 &mut self.version_assignments
757 }
758 pub fn set_version_assignments(&mut self, field: Vec<super::VersionAssignment>) {
760 self.version_assignments = field;
761 }
762 pub fn with_version_assignments(
764 mut self,
765 field: Vec<super::VersionAssignment>,
766 ) -> Self {
767 self.set_version_assignments(field);
768 self
769 }
770 }
771 impl super::ChangeEpoch {
772 pub const fn const_default() -> Self {
773 Self {
774 epoch: None,
775 protocol_version: None,
776 storage_charge: None,
777 computation_charge: None,
778 storage_rebate: None,
779 non_refundable_storage_fee: None,
780 epoch_start_timestamp: None,
781 system_packages: Vec::new(),
782 }
783 }
784 #[doc(hidden)]
785 pub fn default_instance() -> &'static Self {
786 static DEFAULT: super::ChangeEpoch = super::ChangeEpoch::const_default();
787 &DEFAULT
788 }
789 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
791 self.epoch.as_mut().map(|field| field as _)
792 }
793 pub fn epoch_mut(&mut self) -> &mut u64 {
796 self.epoch.get_or_insert_default()
797 }
798 pub fn epoch_opt(&self) -> Option<u64> {
800 self.epoch.as_ref().map(|field| *field)
801 }
802 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
804 self.epoch = Some(field.into().into());
805 }
806 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
808 self.set_epoch(field.into());
809 self
810 }
811 pub fn protocol_version_opt_mut(&mut self) -> Option<&mut u64> {
813 self.protocol_version.as_mut().map(|field| field as _)
814 }
815 pub fn protocol_version_mut(&mut self) -> &mut u64 {
818 self.protocol_version.get_or_insert_default()
819 }
820 pub fn protocol_version_opt(&self) -> Option<u64> {
822 self.protocol_version.as_ref().map(|field| *field)
823 }
824 pub fn set_protocol_version<T: Into<u64>>(&mut self, field: T) {
826 self.protocol_version = Some(field.into().into());
827 }
828 pub fn with_protocol_version<T: Into<u64>>(mut self, field: T) -> Self {
830 self.set_protocol_version(field.into());
831 self
832 }
833 pub fn storage_charge_opt_mut(&mut self) -> Option<&mut u64> {
835 self.storage_charge.as_mut().map(|field| field as _)
836 }
837 pub fn storage_charge_mut(&mut self) -> &mut u64 {
840 self.storage_charge.get_or_insert_default()
841 }
842 pub fn storage_charge_opt(&self) -> Option<u64> {
844 self.storage_charge.as_ref().map(|field| *field)
845 }
846 pub fn set_storage_charge<T: Into<u64>>(&mut self, field: T) {
848 self.storage_charge = Some(field.into().into());
849 }
850 pub fn with_storage_charge<T: Into<u64>>(mut self, field: T) -> Self {
852 self.set_storage_charge(field.into());
853 self
854 }
855 pub fn computation_charge_opt_mut(&mut self) -> Option<&mut u64> {
857 self.computation_charge.as_mut().map(|field| field as _)
858 }
859 pub fn computation_charge_mut(&mut self) -> &mut u64 {
862 self.computation_charge.get_or_insert_default()
863 }
864 pub fn computation_charge_opt(&self) -> Option<u64> {
866 self.computation_charge.as_ref().map(|field| *field)
867 }
868 pub fn set_computation_charge<T: Into<u64>>(&mut self, field: T) {
870 self.computation_charge = Some(field.into().into());
871 }
872 pub fn with_computation_charge<T: Into<u64>>(mut self, field: T) -> Self {
874 self.set_computation_charge(field.into());
875 self
876 }
877 pub fn storage_rebate_opt_mut(&mut self) -> Option<&mut u64> {
879 self.storage_rebate.as_mut().map(|field| field as _)
880 }
881 pub fn storage_rebate_mut(&mut self) -> &mut u64 {
884 self.storage_rebate.get_or_insert_default()
885 }
886 pub fn storage_rebate_opt(&self) -> Option<u64> {
888 self.storage_rebate.as_ref().map(|field| *field)
889 }
890 pub fn set_storage_rebate<T: Into<u64>>(&mut self, field: T) {
892 self.storage_rebate = Some(field.into().into());
893 }
894 pub fn with_storage_rebate<T: Into<u64>>(mut self, field: T) -> Self {
896 self.set_storage_rebate(field.into());
897 self
898 }
899 pub fn non_refundable_storage_fee_opt_mut(&mut self) -> Option<&mut u64> {
901 self.non_refundable_storage_fee.as_mut().map(|field| field as _)
902 }
903 pub fn non_refundable_storage_fee_mut(&mut self) -> &mut u64 {
906 self.non_refundable_storage_fee.get_or_insert_default()
907 }
908 pub fn non_refundable_storage_fee_opt(&self) -> Option<u64> {
910 self.non_refundable_storage_fee.as_ref().map(|field| *field)
911 }
912 pub fn set_non_refundable_storage_fee<T: Into<u64>>(&mut self, field: T) {
914 self.non_refundable_storage_fee = Some(field.into().into());
915 }
916 pub fn with_non_refundable_storage_fee<T: Into<u64>>(
918 mut self,
919 field: T,
920 ) -> Self {
921 self.set_non_refundable_storage_fee(field.into());
922 self
923 }
924 pub fn epoch_start_timestamp_opt_mut(
926 &mut self,
927 ) -> Option<&mut ::prost_types::Timestamp> {
928 self.epoch_start_timestamp.as_mut().map(|field| field as _)
929 }
930 pub fn epoch_start_timestamp_mut(&mut self) -> &mut ::prost_types::Timestamp {
933 self.epoch_start_timestamp.get_or_insert_default()
934 }
935 pub fn epoch_start_timestamp_opt(&self) -> Option<&::prost_types::Timestamp> {
937 self.epoch_start_timestamp.as_ref().map(|field| field as _)
938 }
939 pub fn set_epoch_start_timestamp<T: Into<::prost_types::Timestamp>>(
941 &mut self,
942 field: T,
943 ) {
944 self.epoch_start_timestamp = Some(field.into().into());
945 }
946 pub fn with_epoch_start_timestamp<T: Into<::prost_types::Timestamp>>(
948 mut self,
949 field: T,
950 ) -> Self {
951 self.set_epoch_start_timestamp(field.into());
952 self
953 }
954 pub fn system_packages(&self) -> &[super::SystemPackage] {
956 &self.system_packages
957 }
958 pub fn system_packages_mut(&mut self) -> &mut Vec<super::SystemPackage> {
961 &mut self.system_packages
962 }
963 pub fn set_system_packages(&mut self, field: Vec<super::SystemPackage>) {
965 self.system_packages = field;
966 }
967 pub fn with_system_packages(mut self, field: Vec<super::SystemPackage>) -> Self {
969 self.set_system_packages(field);
970 self
971 }
972 }
973 impl super::ChangedObject {
974 pub const fn const_default() -> Self {
975 Self {
976 object_id: None,
977 input_state: None,
978 input_version: None,
979 input_digest: None,
980 input_owner: None,
981 output_state: None,
982 output_version: None,
983 output_digest: None,
984 output_owner: None,
985 id_operation: None,
986 object_type: None,
987 }
988 }
989 #[doc(hidden)]
990 pub fn default_instance() -> &'static Self {
991 static DEFAULT: super::ChangedObject = super::ChangedObject::const_default();
992 &DEFAULT
993 }
994 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
996 self.object_id.as_mut().map(|field| field as _)
997 }
998 pub fn object_id_mut(&mut self) -> &mut String {
1001 self.object_id.get_or_insert_default()
1002 }
1003 pub fn object_id_opt(&self) -> Option<&str> {
1005 self.object_id.as_ref().map(|field| field as _)
1006 }
1007 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
1009 self.object_id = Some(field.into().into());
1010 }
1011 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
1013 self.set_object_id(field.into());
1014 self
1015 }
1016 pub fn with_input_state<T: Into<super::changed_object::InputObjectState>>(
1018 mut self,
1019 field: T,
1020 ) -> Self {
1021 self.set_input_state(field.into());
1022 self
1023 }
1024 pub fn input_version_opt_mut(&mut self) -> Option<&mut u64> {
1026 self.input_version.as_mut().map(|field| field as _)
1027 }
1028 pub fn input_version_mut(&mut self) -> &mut u64 {
1031 self.input_version.get_or_insert_default()
1032 }
1033 pub fn input_version_opt(&self) -> Option<u64> {
1035 self.input_version.as_ref().map(|field| *field)
1036 }
1037 pub fn set_input_version<T: Into<u64>>(&mut self, field: T) {
1039 self.input_version = Some(field.into().into());
1040 }
1041 pub fn with_input_version<T: Into<u64>>(mut self, field: T) -> Self {
1043 self.set_input_version(field.into());
1044 self
1045 }
1046 pub fn input_digest_opt_mut(&mut self) -> Option<&mut String> {
1048 self.input_digest.as_mut().map(|field| field as _)
1049 }
1050 pub fn input_digest_mut(&mut self) -> &mut String {
1053 self.input_digest.get_or_insert_default()
1054 }
1055 pub fn input_digest_opt(&self) -> Option<&str> {
1057 self.input_digest.as_ref().map(|field| field as _)
1058 }
1059 pub fn set_input_digest<T: Into<String>>(&mut self, field: T) {
1061 self.input_digest = Some(field.into().into());
1062 }
1063 pub fn with_input_digest<T: Into<String>>(mut self, field: T) -> Self {
1065 self.set_input_digest(field.into());
1066 self
1067 }
1068 pub fn input_owner(&self) -> &super::Owner {
1070 self.input_owner
1071 .as_ref()
1072 .map(|field| field as _)
1073 .unwrap_or_else(|| super::Owner::default_instance() as _)
1074 }
1075 pub fn input_owner_opt_mut(&mut self) -> Option<&mut super::Owner> {
1077 self.input_owner.as_mut().map(|field| field as _)
1078 }
1079 pub fn input_owner_mut(&mut self) -> &mut super::Owner {
1082 self.input_owner.get_or_insert_default()
1083 }
1084 pub fn input_owner_opt(&self) -> Option<&super::Owner> {
1086 self.input_owner.as_ref().map(|field| field as _)
1087 }
1088 pub fn set_input_owner<T: Into<super::Owner>>(&mut self, field: T) {
1090 self.input_owner = Some(field.into().into());
1091 }
1092 pub fn with_input_owner<T: Into<super::Owner>>(mut self, field: T) -> Self {
1094 self.set_input_owner(field.into());
1095 self
1096 }
1097 pub fn with_output_state<T: Into<super::changed_object::OutputObjectState>>(
1099 mut self,
1100 field: T,
1101 ) -> Self {
1102 self.set_output_state(field.into());
1103 self
1104 }
1105 pub fn output_version_opt_mut(&mut self) -> Option<&mut u64> {
1107 self.output_version.as_mut().map(|field| field as _)
1108 }
1109 pub fn output_version_mut(&mut self) -> &mut u64 {
1112 self.output_version.get_or_insert_default()
1113 }
1114 pub fn output_version_opt(&self) -> Option<u64> {
1116 self.output_version.as_ref().map(|field| *field)
1117 }
1118 pub fn set_output_version<T: Into<u64>>(&mut self, field: T) {
1120 self.output_version = Some(field.into().into());
1121 }
1122 pub fn with_output_version<T: Into<u64>>(mut self, field: T) -> Self {
1124 self.set_output_version(field.into());
1125 self
1126 }
1127 pub fn output_digest_opt_mut(&mut self) -> Option<&mut String> {
1129 self.output_digest.as_mut().map(|field| field as _)
1130 }
1131 pub fn output_digest_mut(&mut self) -> &mut String {
1134 self.output_digest.get_or_insert_default()
1135 }
1136 pub fn output_digest_opt(&self) -> Option<&str> {
1138 self.output_digest.as_ref().map(|field| field as _)
1139 }
1140 pub fn set_output_digest<T: Into<String>>(&mut self, field: T) {
1142 self.output_digest = Some(field.into().into());
1143 }
1144 pub fn with_output_digest<T: Into<String>>(mut self, field: T) -> Self {
1146 self.set_output_digest(field.into());
1147 self
1148 }
1149 pub fn output_owner(&self) -> &super::Owner {
1151 self.output_owner
1152 .as_ref()
1153 .map(|field| field as _)
1154 .unwrap_or_else(|| super::Owner::default_instance() as _)
1155 }
1156 pub fn output_owner_opt_mut(&mut self) -> Option<&mut super::Owner> {
1158 self.output_owner.as_mut().map(|field| field as _)
1159 }
1160 pub fn output_owner_mut(&mut self) -> &mut super::Owner {
1163 self.output_owner.get_or_insert_default()
1164 }
1165 pub fn output_owner_opt(&self) -> Option<&super::Owner> {
1167 self.output_owner.as_ref().map(|field| field as _)
1168 }
1169 pub fn set_output_owner<T: Into<super::Owner>>(&mut self, field: T) {
1171 self.output_owner = Some(field.into().into());
1172 }
1173 pub fn with_output_owner<T: Into<super::Owner>>(mut self, field: T) -> Self {
1175 self.set_output_owner(field.into());
1176 self
1177 }
1178 pub fn with_id_operation<T: Into<super::changed_object::IdOperation>>(
1180 mut self,
1181 field: T,
1182 ) -> Self {
1183 self.set_id_operation(field.into());
1184 self
1185 }
1186 pub fn object_type_opt_mut(&mut self) -> Option<&mut String> {
1188 self.object_type.as_mut().map(|field| field as _)
1189 }
1190 pub fn object_type_mut(&mut self) -> &mut String {
1193 self.object_type.get_or_insert_default()
1194 }
1195 pub fn object_type_opt(&self) -> Option<&str> {
1197 self.object_type.as_ref().map(|field| field as _)
1198 }
1199 pub fn set_object_type<T: Into<String>>(&mut self, field: T) {
1201 self.object_type = Some(field.into().into());
1202 }
1203 pub fn with_object_type<T: Into<String>>(mut self, field: T) -> Self {
1205 self.set_object_type(field.into());
1206 self
1207 }
1208 }
1209 impl super::Checkpoint {
1210 pub const fn const_default() -> Self {
1211 Self {
1212 sequence_number: None,
1213 digest: None,
1214 summary: None,
1215 signature: None,
1216 contents: None,
1217 transactions: Vec::new(),
1218 }
1219 }
1220 #[doc(hidden)]
1221 pub fn default_instance() -> &'static Self {
1222 static DEFAULT: super::Checkpoint = super::Checkpoint::const_default();
1223 &DEFAULT
1224 }
1225 pub fn sequence_number_opt_mut(&mut self) -> Option<&mut u64> {
1227 self.sequence_number.as_mut().map(|field| field as _)
1228 }
1229 pub fn sequence_number_mut(&mut self) -> &mut u64 {
1232 self.sequence_number.get_or_insert_default()
1233 }
1234 pub fn sequence_number_opt(&self) -> Option<u64> {
1236 self.sequence_number.as_ref().map(|field| *field)
1237 }
1238 pub fn set_sequence_number<T: Into<u64>>(&mut self, field: T) {
1240 self.sequence_number = Some(field.into().into());
1241 }
1242 pub fn with_sequence_number<T: Into<u64>>(mut self, field: T) -> Self {
1244 self.set_sequence_number(field.into());
1245 self
1246 }
1247 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
1249 self.digest.as_mut().map(|field| field as _)
1250 }
1251 pub fn digest_mut(&mut self) -> &mut String {
1254 self.digest.get_or_insert_default()
1255 }
1256 pub fn digest_opt(&self) -> Option<&str> {
1258 self.digest.as_ref().map(|field| field as _)
1259 }
1260 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
1262 self.digest = Some(field.into().into());
1263 }
1264 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
1266 self.set_digest(field.into());
1267 self
1268 }
1269 pub fn summary(&self) -> &super::CheckpointSummary {
1271 self.summary
1272 .as_ref()
1273 .map(|field| field as _)
1274 .unwrap_or_else(|| super::CheckpointSummary::default_instance() as _)
1275 }
1276 pub fn summary_opt_mut(&mut self) -> Option<&mut super::CheckpointSummary> {
1278 self.summary.as_mut().map(|field| field as _)
1279 }
1280 pub fn summary_mut(&mut self) -> &mut super::CheckpointSummary {
1283 self.summary.get_or_insert_default()
1284 }
1285 pub fn summary_opt(&self) -> Option<&super::CheckpointSummary> {
1287 self.summary.as_ref().map(|field| field as _)
1288 }
1289 pub fn set_summary<T: Into<super::CheckpointSummary>>(&mut self, field: T) {
1291 self.summary = Some(field.into().into());
1292 }
1293 pub fn with_summary<T: Into<super::CheckpointSummary>>(
1295 mut self,
1296 field: T,
1297 ) -> Self {
1298 self.set_summary(field.into());
1299 self
1300 }
1301 pub fn signature(&self) -> &super::ValidatorAggregatedSignature {
1303 self.signature
1304 .as_ref()
1305 .map(|field| field as _)
1306 .unwrap_or_else(|| {
1307 super::ValidatorAggregatedSignature::default_instance() as _
1308 })
1309 }
1310 pub fn signature_opt_mut(
1312 &mut self,
1313 ) -> Option<&mut super::ValidatorAggregatedSignature> {
1314 self.signature.as_mut().map(|field| field as _)
1315 }
1316 pub fn signature_mut(&mut self) -> &mut super::ValidatorAggregatedSignature {
1319 self.signature.get_or_insert_default()
1320 }
1321 pub fn signature_opt(&self) -> Option<&super::ValidatorAggregatedSignature> {
1323 self.signature.as_ref().map(|field| field as _)
1324 }
1325 pub fn set_signature<T: Into<super::ValidatorAggregatedSignature>>(
1327 &mut self,
1328 field: T,
1329 ) {
1330 self.signature = Some(field.into().into());
1331 }
1332 pub fn with_signature<T: Into<super::ValidatorAggregatedSignature>>(
1334 mut self,
1335 field: T,
1336 ) -> Self {
1337 self.set_signature(field.into());
1338 self
1339 }
1340 pub fn contents(&self) -> &super::CheckpointContents {
1342 self.contents
1343 .as_ref()
1344 .map(|field| field as _)
1345 .unwrap_or_else(|| super::CheckpointContents::default_instance() as _)
1346 }
1347 pub fn contents_opt_mut(&mut self) -> Option<&mut super::CheckpointContents> {
1349 self.contents.as_mut().map(|field| field as _)
1350 }
1351 pub fn contents_mut(&mut self) -> &mut super::CheckpointContents {
1354 self.contents.get_or_insert_default()
1355 }
1356 pub fn contents_opt(&self) -> Option<&super::CheckpointContents> {
1358 self.contents.as_ref().map(|field| field as _)
1359 }
1360 pub fn set_contents<T: Into<super::CheckpointContents>>(&mut self, field: T) {
1362 self.contents = Some(field.into().into());
1363 }
1364 pub fn with_contents<T: Into<super::CheckpointContents>>(
1366 mut self,
1367 field: T,
1368 ) -> Self {
1369 self.set_contents(field.into());
1370 self
1371 }
1372 pub fn transactions(&self) -> &[super::ExecutedTransaction] {
1374 &self.transactions
1375 }
1376 pub fn transactions_mut(&mut self) -> &mut Vec<super::ExecutedTransaction> {
1379 &mut self.transactions
1380 }
1381 pub fn set_transactions(&mut self, field: Vec<super::ExecutedTransaction>) {
1383 self.transactions = field;
1384 }
1385 pub fn with_transactions(
1387 mut self,
1388 field: Vec<super::ExecutedTransaction>,
1389 ) -> Self {
1390 self.set_transactions(field);
1391 self
1392 }
1393 }
1394 impl super::CheckpointCommitment {
1395 pub const fn const_default() -> Self {
1396 Self { kind: None, digest: None }
1397 }
1398 #[doc(hidden)]
1399 pub fn default_instance() -> &'static Self {
1400 static DEFAULT: super::CheckpointCommitment = super::CheckpointCommitment::const_default();
1401 &DEFAULT
1402 }
1403 pub fn with_kind<
1405 T: Into<super::checkpoint_commitment::CheckpointCommitmentKind>,
1406 >(mut self, field: T) -> Self {
1407 self.set_kind(field.into());
1408 self
1409 }
1410 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
1412 self.digest.as_mut().map(|field| field as _)
1413 }
1414 pub fn digest_mut(&mut self) -> &mut String {
1417 self.digest.get_or_insert_default()
1418 }
1419 pub fn digest_opt(&self) -> Option<&str> {
1421 self.digest.as_ref().map(|field| field as _)
1422 }
1423 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
1425 self.digest = Some(field.into().into());
1426 }
1427 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
1429 self.set_digest(field.into());
1430 self
1431 }
1432 }
1433 impl super::CheckpointContents {
1434 pub const fn const_default() -> Self {
1435 Self {
1436 bcs: None,
1437 digest: None,
1438 version: None,
1439 transactions: Vec::new(),
1440 }
1441 }
1442 #[doc(hidden)]
1443 pub fn default_instance() -> &'static Self {
1444 static DEFAULT: super::CheckpointContents = super::CheckpointContents::const_default();
1445 &DEFAULT
1446 }
1447 pub fn bcs(&self) -> &super::Bcs {
1449 self.bcs
1450 .as_ref()
1451 .map(|field| field as _)
1452 .unwrap_or_else(|| super::Bcs::default_instance() as _)
1453 }
1454 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
1456 self.bcs.as_mut().map(|field| field as _)
1457 }
1458 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
1461 self.bcs.get_or_insert_default()
1462 }
1463 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
1465 self.bcs.as_ref().map(|field| field as _)
1466 }
1467 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
1469 self.bcs = Some(field.into().into());
1470 }
1471 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
1473 self.set_bcs(field.into());
1474 self
1475 }
1476 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
1478 self.digest.as_mut().map(|field| field as _)
1479 }
1480 pub fn digest_mut(&mut self) -> &mut String {
1483 self.digest.get_or_insert_default()
1484 }
1485 pub fn digest_opt(&self) -> Option<&str> {
1487 self.digest.as_ref().map(|field| field as _)
1488 }
1489 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
1491 self.digest = Some(field.into().into());
1492 }
1493 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
1495 self.set_digest(field.into());
1496 self
1497 }
1498 pub fn version_opt_mut(&mut self) -> Option<&mut i32> {
1500 self.version.as_mut().map(|field| field as _)
1501 }
1502 pub fn version_mut(&mut self) -> &mut i32 {
1505 self.version.get_or_insert_default()
1506 }
1507 pub fn version_opt(&self) -> Option<i32> {
1509 self.version.as_ref().map(|field| *field)
1510 }
1511 pub fn set_version<T: Into<i32>>(&mut self, field: T) {
1513 self.version = Some(field.into().into());
1514 }
1515 pub fn with_version<T: Into<i32>>(mut self, field: T) -> Self {
1517 self.set_version(field.into());
1518 self
1519 }
1520 pub fn transactions(&self) -> &[super::CheckpointedTransactionInfo] {
1522 &self.transactions
1523 }
1524 pub fn transactions_mut(
1527 &mut self,
1528 ) -> &mut Vec<super::CheckpointedTransactionInfo> {
1529 &mut self.transactions
1530 }
1531 pub fn set_transactions(
1533 &mut self,
1534 field: Vec<super::CheckpointedTransactionInfo>,
1535 ) {
1536 self.transactions = field;
1537 }
1538 pub fn with_transactions(
1540 mut self,
1541 field: Vec<super::CheckpointedTransactionInfo>,
1542 ) -> Self {
1543 self.set_transactions(field);
1544 self
1545 }
1546 }
1547 impl super::CheckpointSummary {
1548 pub const fn const_default() -> Self {
1549 Self {
1550 bcs: None,
1551 digest: None,
1552 epoch: None,
1553 sequence_number: None,
1554 total_network_transactions: None,
1555 content_digest: None,
1556 previous_digest: None,
1557 epoch_rolling_gas_cost_summary: None,
1558 timestamp: None,
1559 commitments: Vec::new(),
1560 end_of_epoch_data: None,
1561 version_specific_data: None,
1562 }
1563 }
1564 #[doc(hidden)]
1565 pub fn default_instance() -> &'static Self {
1566 static DEFAULT: super::CheckpointSummary = super::CheckpointSummary::const_default();
1567 &DEFAULT
1568 }
1569 pub fn bcs(&self) -> &super::Bcs {
1571 self.bcs
1572 .as_ref()
1573 .map(|field| field as _)
1574 .unwrap_or_else(|| super::Bcs::default_instance() as _)
1575 }
1576 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
1578 self.bcs.as_mut().map(|field| field as _)
1579 }
1580 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
1583 self.bcs.get_or_insert_default()
1584 }
1585 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
1587 self.bcs.as_ref().map(|field| field as _)
1588 }
1589 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
1591 self.bcs = Some(field.into().into());
1592 }
1593 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
1595 self.set_bcs(field.into());
1596 self
1597 }
1598 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
1600 self.digest.as_mut().map(|field| field as _)
1601 }
1602 pub fn digest_mut(&mut self) -> &mut String {
1605 self.digest.get_or_insert_default()
1606 }
1607 pub fn digest_opt(&self) -> Option<&str> {
1609 self.digest.as_ref().map(|field| field as _)
1610 }
1611 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
1613 self.digest = Some(field.into().into());
1614 }
1615 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
1617 self.set_digest(field.into());
1618 self
1619 }
1620 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
1622 self.epoch.as_mut().map(|field| field as _)
1623 }
1624 pub fn epoch_mut(&mut self) -> &mut u64 {
1627 self.epoch.get_or_insert_default()
1628 }
1629 pub fn epoch_opt(&self) -> Option<u64> {
1631 self.epoch.as_ref().map(|field| *field)
1632 }
1633 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
1635 self.epoch = Some(field.into().into());
1636 }
1637 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
1639 self.set_epoch(field.into());
1640 self
1641 }
1642 pub fn sequence_number_opt_mut(&mut self) -> Option<&mut u64> {
1644 self.sequence_number.as_mut().map(|field| field as _)
1645 }
1646 pub fn sequence_number_mut(&mut self) -> &mut u64 {
1649 self.sequence_number.get_or_insert_default()
1650 }
1651 pub fn sequence_number_opt(&self) -> Option<u64> {
1653 self.sequence_number.as_ref().map(|field| *field)
1654 }
1655 pub fn set_sequence_number<T: Into<u64>>(&mut self, field: T) {
1657 self.sequence_number = Some(field.into().into());
1658 }
1659 pub fn with_sequence_number<T: Into<u64>>(mut self, field: T) -> Self {
1661 self.set_sequence_number(field.into());
1662 self
1663 }
1664 pub fn total_network_transactions_opt_mut(&mut self) -> Option<&mut u64> {
1666 self.total_network_transactions.as_mut().map(|field| field as _)
1667 }
1668 pub fn total_network_transactions_mut(&mut self) -> &mut u64 {
1671 self.total_network_transactions.get_or_insert_default()
1672 }
1673 pub fn total_network_transactions_opt(&self) -> Option<u64> {
1675 self.total_network_transactions.as_ref().map(|field| *field)
1676 }
1677 pub fn set_total_network_transactions<T: Into<u64>>(&mut self, field: T) {
1679 self.total_network_transactions = Some(field.into().into());
1680 }
1681 pub fn with_total_network_transactions<T: Into<u64>>(
1683 mut self,
1684 field: T,
1685 ) -> Self {
1686 self.set_total_network_transactions(field.into());
1687 self
1688 }
1689 pub fn content_digest_opt_mut(&mut self) -> Option<&mut String> {
1691 self.content_digest.as_mut().map(|field| field as _)
1692 }
1693 pub fn content_digest_mut(&mut self) -> &mut String {
1696 self.content_digest.get_or_insert_default()
1697 }
1698 pub fn content_digest_opt(&self) -> Option<&str> {
1700 self.content_digest.as_ref().map(|field| field as _)
1701 }
1702 pub fn set_content_digest<T: Into<String>>(&mut self, field: T) {
1704 self.content_digest = Some(field.into().into());
1705 }
1706 pub fn with_content_digest<T: Into<String>>(mut self, field: T) -> Self {
1708 self.set_content_digest(field.into());
1709 self
1710 }
1711 pub fn previous_digest_opt_mut(&mut self) -> Option<&mut String> {
1713 self.previous_digest.as_mut().map(|field| field as _)
1714 }
1715 pub fn previous_digest_mut(&mut self) -> &mut String {
1718 self.previous_digest.get_or_insert_default()
1719 }
1720 pub fn previous_digest_opt(&self) -> Option<&str> {
1722 self.previous_digest.as_ref().map(|field| field as _)
1723 }
1724 pub fn set_previous_digest<T: Into<String>>(&mut self, field: T) {
1726 self.previous_digest = Some(field.into().into());
1727 }
1728 pub fn with_previous_digest<T: Into<String>>(mut self, field: T) -> Self {
1730 self.set_previous_digest(field.into());
1731 self
1732 }
1733 pub fn epoch_rolling_gas_cost_summary(&self) -> &super::GasCostSummary {
1735 self.epoch_rolling_gas_cost_summary
1736 .as_ref()
1737 .map(|field| field as _)
1738 .unwrap_or_else(|| super::GasCostSummary::default_instance() as _)
1739 }
1740 pub fn epoch_rolling_gas_cost_summary_opt_mut(
1742 &mut self,
1743 ) -> Option<&mut super::GasCostSummary> {
1744 self.epoch_rolling_gas_cost_summary.as_mut().map(|field| field as _)
1745 }
1746 pub fn epoch_rolling_gas_cost_summary_mut(
1749 &mut self,
1750 ) -> &mut super::GasCostSummary {
1751 self.epoch_rolling_gas_cost_summary.get_or_insert_default()
1752 }
1753 pub fn epoch_rolling_gas_cost_summary_opt(
1755 &self,
1756 ) -> Option<&super::GasCostSummary> {
1757 self.epoch_rolling_gas_cost_summary.as_ref().map(|field| field as _)
1758 }
1759 pub fn set_epoch_rolling_gas_cost_summary<T: Into<super::GasCostSummary>>(
1761 &mut self,
1762 field: T,
1763 ) {
1764 self.epoch_rolling_gas_cost_summary = Some(field.into().into());
1765 }
1766 pub fn with_epoch_rolling_gas_cost_summary<T: Into<super::GasCostSummary>>(
1768 mut self,
1769 field: T,
1770 ) -> Self {
1771 self.set_epoch_rolling_gas_cost_summary(field.into());
1772 self
1773 }
1774 pub fn timestamp_opt_mut(&mut self) -> Option<&mut ::prost_types::Timestamp> {
1776 self.timestamp.as_mut().map(|field| field as _)
1777 }
1778 pub fn timestamp_mut(&mut self) -> &mut ::prost_types::Timestamp {
1781 self.timestamp.get_or_insert_default()
1782 }
1783 pub fn timestamp_opt(&self) -> Option<&::prost_types::Timestamp> {
1785 self.timestamp.as_ref().map(|field| field as _)
1786 }
1787 pub fn set_timestamp<T: Into<::prost_types::Timestamp>>(&mut self, field: T) {
1789 self.timestamp = Some(field.into().into());
1790 }
1791 pub fn with_timestamp<T: Into<::prost_types::Timestamp>>(
1793 mut self,
1794 field: T,
1795 ) -> Self {
1796 self.set_timestamp(field.into());
1797 self
1798 }
1799 pub fn commitments(&self) -> &[super::CheckpointCommitment] {
1801 &self.commitments
1802 }
1803 pub fn commitments_mut(&mut self) -> &mut Vec<super::CheckpointCommitment> {
1806 &mut self.commitments
1807 }
1808 pub fn set_commitments(&mut self, field: Vec<super::CheckpointCommitment>) {
1810 self.commitments = field;
1811 }
1812 pub fn with_commitments(
1814 mut self,
1815 field: Vec<super::CheckpointCommitment>,
1816 ) -> Self {
1817 self.set_commitments(field);
1818 self
1819 }
1820 pub fn end_of_epoch_data(&self) -> &super::EndOfEpochData {
1822 self.end_of_epoch_data
1823 .as_ref()
1824 .map(|field| field as _)
1825 .unwrap_or_else(|| super::EndOfEpochData::default_instance() as _)
1826 }
1827 pub fn end_of_epoch_data_opt_mut(
1829 &mut self,
1830 ) -> Option<&mut super::EndOfEpochData> {
1831 self.end_of_epoch_data.as_mut().map(|field| field as _)
1832 }
1833 pub fn end_of_epoch_data_mut(&mut self) -> &mut super::EndOfEpochData {
1836 self.end_of_epoch_data.get_or_insert_default()
1837 }
1838 pub fn end_of_epoch_data_opt(&self) -> Option<&super::EndOfEpochData> {
1840 self.end_of_epoch_data.as_ref().map(|field| field as _)
1841 }
1842 pub fn set_end_of_epoch_data<T: Into<super::EndOfEpochData>>(
1844 &mut self,
1845 field: T,
1846 ) {
1847 self.end_of_epoch_data = Some(field.into().into());
1848 }
1849 pub fn with_end_of_epoch_data<T: Into<super::EndOfEpochData>>(
1851 mut self,
1852 field: T,
1853 ) -> Self {
1854 self.set_end_of_epoch_data(field.into());
1855 self
1856 }
1857 pub fn version_specific_data_opt(&self) -> Option<&[u8]> {
1859 self.version_specific_data.as_ref().map(|field| field as _)
1860 }
1861 pub fn set_version_specific_data<T: Into<::prost::bytes::Bytes>>(
1863 &mut self,
1864 field: T,
1865 ) {
1866 self.version_specific_data = Some(field.into().into());
1867 }
1868 pub fn with_version_specific_data<T: Into<::prost::bytes::Bytes>>(
1870 mut self,
1871 field: T,
1872 ) -> Self {
1873 self.set_version_specific_data(field.into());
1874 self
1875 }
1876 }
1877 impl super::CheckpointedTransactionInfo {
1878 pub const fn const_default() -> Self {
1879 Self {
1880 transaction: None,
1881 effects: None,
1882 signatures: Vec::new(),
1883 }
1884 }
1885 #[doc(hidden)]
1886 pub fn default_instance() -> &'static Self {
1887 static DEFAULT: super::CheckpointedTransactionInfo = super::CheckpointedTransactionInfo::const_default();
1888 &DEFAULT
1889 }
1890 pub fn transaction_opt_mut(&mut self) -> Option<&mut String> {
1892 self.transaction.as_mut().map(|field| field as _)
1893 }
1894 pub fn transaction_mut(&mut self) -> &mut String {
1897 self.transaction.get_or_insert_default()
1898 }
1899 pub fn transaction_opt(&self) -> Option<&str> {
1901 self.transaction.as_ref().map(|field| field as _)
1902 }
1903 pub fn set_transaction<T: Into<String>>(&mut self, field: T) {
1905 self.transaction = Some(field.into().into());
1906 }
1907 pub fn with_transaction<T: Into<String>>(mut self, field: T) -> Self {
1909 self.set_transaction(field.into());
1910 self
1911 }
1912 pub fn effects_opt_mut(&mut self) -> Option<&mut String> {
1914 self.effects.as_mut().map(|field| field as _)
1915 }
1916 pub fn effects_mut(&mut self) -> &mut String {
1919 self.effects.get_or_insert_default()
1920 }
1921 pub fn effects_opt(&self) -> Option<&str> {
1923 self.effects.as_ref().map(|field| field as _)
1924 }
1925 pub fn set_effects<T: Into<String>>(&mut self, field: T) {
1927 self.effects = Some(field.into().into());
1928 }
1929 pub fn with_effects<T: Into<String>>(mut self, field: T) -> Self {
1931 self.set_effects(field.into());
1932 self
1933 }
1934 pub fn signatures(&self) -> &[super::UserSignature] {
1936 &self.signatures
1937 }
1938 pub fn signatures_mut(&mut self) -> &mut Vec<super::UserSignature> {
1941 &mut self.signatures
1942 }
1943 pub fn set_signatures(&mut self, field: Vec<super::UserSignature>) {
1945 self.signatures = field;
1946 }
1947 pub fn with_signatures(mut self, field: Vec<super::UserSignature>) -> Self {
1949 self.set_signatures(field);
1950 self
1951 }
1952 }
1953 impl super::CircomG1 {
1954 pub const fn const_default() -> Self {
1955 Self {
1956 e0: None,
1957 e1: None,
1958 e2: None,
1959 }
1960 }
1961 #[doc(hidden)]
1962 pub fn default_instance() -> &'static Self {
1963 static DEFAULT: super::CircomG1 = super::CircomG1::const_default();
1964 &DEFAULT
1965 }
1966 pub fn e0_opt_mut(&mut self) -> Option<&mut String> {
1968 self.e0.as_mut().map(|field| field as _)
1969 }
1970 pub fn e0_mut(&mut self) -> &mut String {
1973 self.e0.get_or_insert_default()
1974 }
1975 pub fn e0_opt(&self) -> Option<&str> {
1977 self.e0.as_ref().map(|field| field as _)
1978 }
1979 pub fn set_e0<T: Into<String>>(&mut self, field: T) {
1981 self.e0 = Some(field.into().into());
1982 }
1983 pub fn with_e0<T: Into<String>>(mut self, field: T) -> Self {
1985 self.set_e0(field.into());
1986 self
1987 }
1988 pub fn e1_opt_mut(&mut self) -> Option<&mut String> {
1990 self.e1.as_mut().map(|field| field as _)
1991 }
1992 pub fn e1_mut(&mut self) -> &mut String {
1995 self.e1.get_or_insert_default()
1996 }
1997 pub fn e1_opt(&self) -> Option<&str> {
1999 self.e1.as_ref().map(|field| field as _)
2000 }
2001 pub fn set_e1<T: Into<String>>(&mut self, field: T) {
2003 self.e1 = Some(field.into().into());
2004 }
2005 pub fn with_e1<T: Into<String>>(mut self, field: T) -> Self {
2007 self.set_e1(field.into());
2008 self
2009 }
2010 pub fn e2_opt_mut(&mut self) -> Option<&mut String> {
2012 self.e2.as_mut().map(|field| field as _)
2013 }
2014 pub fn e2_mut(&mut self) -> &mut String {
2017 self.e2.get_or_insert_default()
2018 }
2019 pub fn e2_opt(&self) -> Option<&str> {
2021 self.e2.as_ref().map(|field| field as _)
2022 }
2023 pub fn set_e2<T: Into<String>>(&mut self, field: T) {
2025 self.e2 = Some(field.into().into());
2026 }
2027 pub fn with_e2<T: Into<String>>(mut self, field: T) -> Self {
2029 self.set_e2(field.into());
2030 self
2031 }
2032 }
2033 impl super::CircomG2 {
2034 pub const fn const_default() -> Self {
2035 Self {
2036 e00: None,
2037 e01: None,
2038 e10: None,
2039 e11: None,
2040 e20: None,
2041 e21: None,
2042 }
2043 }
2044 #[doc(hidden)]
2045 pub fn default_instance() -> &'static Self {
2046 static DEFAULT: super::CircomG2 = super::CircomG2::const_default();
2047 &DEFAULT
2048 }
2049 pub fn e00_opt_mut(&mut self) -> Option<&mut String> {
2051 self.e00.as_mut().map(|field| field as _)
2052 }
2053 pub fn e00_mut(&mut self) -> &mut String {
2056 self.e00.get_or_insert_default()
2057 }
2058 pub fn e00_opt(&self) -> Option<&str> {
2060 self.e00.as_ref().map(|field| field as _)
2061 }
2062 pub fn set_e00<T: Into<String>>(&mut self, field: T) {
2064 self.e00 = Some(field.into().into());
2065 }
2066 pub fn with_e00<T: Into<String>>(mut self, field: T) -> Self {
2068 self.set_e00(field.into());
2069 self
2070 }
2071 pub fn e01_opt_mut(&mut self) -> Option<&mut String> {
2073 self.e01.as_mut().map(|field| field as _)
2074 }
2075 pub fn e01_mut(&mut self) -> &mut String {
2078 self.e01.get_or_insert_default()
2079 }
2080 pub fn e01_opt(&self) -> Option<&str> {
2082 self.e01.as_ref().map(|field| field as _)
2083 }
2084 pub fn set_e01<T: Into<String>>(&mut self, field: T) {
2086 self.e01 = Some(field.into().into());
2087 }
2088 pub fn with_e01<T: Into<String>>(mut self, field: T) -> Self {
2090 self.set_e01(field.into());
2091 self
2092 }
2093 pub fn e10_opt_mut(&mut self) -> Option<&mut String> {
2095 self.e10.as_mut().map(|field| field as _)
2096 }
2097 pub fn e10_mut(&mut self) -> &mut String {
2100 self.e10.get_or_insert_default()
2101 }
2102 pub fn e10_opt(&self) -> Option<&str> {
2104 self.e10.as_ref().map(|field| field as _)
2105 }
2106 pub fn set_e10<T: Into<String>>(&mut self, field: T) {
2108 self.e10 = Some(field.into().into());
2109 }
2110 pub fn with_e10<T: Into<String>>(mut self, field: T) -> Self {
2112 self.set_e10(field.into());
2113 self
2114 }
2115 pub fn e11_opt_mut(&mut self) -> Option<&mut String> {
2117 self.e11.as_mut().map(|field| field as _)
2118 }
2119 pub fn e11_mut(&mut self) -> &mut String {
2122 self.e11.get_or_insert_default()
2123 }
2124 pub fn e11_opt(&self) -> Option<&str> {
2126 self.e11.as_ref().map(|field| field as _)
2127 }
2128 pub fn set_e11<T: Into<String>>(&mut self, field: T) {
2130 self.e11 = Some(field.into().into());
2131 }
2132 pub fn with_e11<T: Into<String>>(mut self, field: T) -> Self {
2134 self.set_e11(field.into());
2135 self
2136 }
2137 pub fn e20_opt_mut(&mut self) -> Option<&mut String> {
2139 self.e20.as_mut().map(|field| field as _)
2140 }
2141 pub fn e20_mut(&mut self) -> &mut String {
2144 self.e20.get_or_insert_default()
2145 }
2146 pub fn e20_opt(&self) -> Option<&str> {
2148 self.e20.as_ref().map(|field| field as _)
2149 }
2150 pub fn set_e20<T: Into<String>>(&mut self, field: T) {
2152 self.e20 = Some(field.into().into());
2153 }
2154 pub fn with_e20<T: Into<String>>(mut self, field: T) -> Self {
2156 self.set_e20(field.into());
2157 self
2158 }
2159 pub fn e21_opt_mut(&mut self) -> Option<&mut String> {
2161 self.e21.as_mut().map(|field| field as _)
2162 }
2163 pub fn e21_mut(&mut self) -> &mut String {
2166 self.e21.get_or_insert_default()
2167 }
2168 pub fn e21_opt(&self) -> Option<&str> {
2170 self.e21.as_ref().map(|field| field as _)
2171 }
2172 pub fn set_e21<T: Into<String>>(&mut self, field: T) {
2174 self.e21 = Some(field.into().into());
2175 }
2176 pub fn with_e21<T: Into<String>>(mut self, field: T) -> Self {
2178 self.set_e21(field.into());
2179 self
2180 }
2181 }
2182 impl super::CleverError {
2183 pub const fn const_default() -> Self {
2184 Self {
2185 error_code: None,
2186 line_number: None,
2187 constant_name: None,
2188 constant_type: None,
2189 value: None,
2190 }
2191 }
2192 #[doc(hidden)]
2193 pub fn default_instance() -> &'static Self {
2194 static DEFAULT: super::CleverError = super::CleverError::const_default();
2195 &DEFAULT
2196 }
2197 pub fn error_code_opt_mut(&mut self) -> Option<&mut u64> {
2199 self.error_code.as_mut().map(|field| field as _)
2200 }
2201 pub fn error_code_mut(&mut self) -> &mut u64 {
2204 self.error_code.get_or_insert_default()
2205 }
2206 pub fn error_code_opt(&self) -> Option<u64> {
2208 self.error_code.as_ref().map(|field| *field)
2209 }
2210 pub fn set_error_code<T: Into<u64>>(&mut self, field: T) {
2212 self.error_code = Some(field.into().into());
2213 }
2214 pub fn with_error_code<T: Into<u64>>(mut self, field: T) -> Self {
2216 self.set_error_code(field.into());
2217 self
2218 }
2219 pub fn line_number_opt_mut(&mut self) -> Option<&mut u64> {
2221 self.line_number.as_mut().map(|field| field as _)
2222 }
2223 pub fn line_number_mut(&mut self) -> &mut u64 {
2226 self.line_number.get_or_insert_default()
2227 }
2228 pub fn line_number_opt(&self) -> Option<u64> {
2230 self.line_number.as_ref().map(|field| *field)
2231 }
2232 pub fn set_line_number<T: Into<u64>>(&mut self, field: T) {
2234 self.line_number = Some(field.into().into());
2235 }
2236 pub fn with_line_number<T: Into<u64>>(mut self, field: T) -> Self {
2238 self.set_line_number(field.into());
2239 self
2240 }
2241 pub fn constant_name_opt_mut(&mut self) -> Option<&mut String> {
2243 self.constant_name.as_mut().map(|field| field as _)
2244 }
2245 pub fn constant_name_mut(&mut self) -> &mut String {
2248 self.constant_name.get_or_insert_default()
2249 }
2250 pub fn constant_name_opt(&self) -> Option<&str> {
2252 self.constant_name.as_ref().map(|field| field as _)
2253 }
2254 pub fn set_constant_name<T: Into<String>>(&mut self, field: T) {
2256 self.constant_name = Some(field.into().into());
2257 }
2258 pub fn with_constant_name<T: Into<String>>(mut self, field: T) -> Self {
2260 self.set_constant_name(field.into());
2261 self
2262 }
2263 pub fn constant_type_opt_mut(&mut self) -> Option<&mut String> {
2265 self.constant_type.as_mut().map(|field| field as _)
2266 }
2267 pub fn constant_type_mut(&mut self) -> &mut String {
2270 self.constant_type.get_or_insert_default()
2271 }
2272 pub fn constant_type_opt(&self) -> Option<&str> {
2274 self.constant_type.as_ref().map(|field| field as _)
2275 }
2276 pub fn set_constant_type<T: Into<String>>(&mut self, field: T) {
2278 self.constant_type = Some(field.into().into());
2279 }
2280 pub fn with_constant_type<T: Into<String>>(mut self, field: T) -> Self {
2282 self.set_constant_type(field.into());
2283 self
2284 }
2285 pub fn rendered(&self) -> &str {
2287 if let Some(super::clever_error::Value::Rendered(field)) = &self.value {
2288 field as _
2289 } else {
2290 ""
2291 }
2292 }
2293 pub fn rendered_opt(&self) -> Option<&str> {
2295 if let Some(super::clever_error::Value::Rendered(field)) = &self.value {
2296 Some(field as _)
2297 } else {
2298 None
2299 }
2300 }
2301 pub fn rendered_opt_mut(&mut self) -> Option<&mut String> {
2303 if let Some(super::clever_error::Value::Rendered(field)) = &mut self.value {
2304 Some(field as _)
2305 } else {
2306 None
2307 }
2308 }
2309 pub fn rendered_mut(&mut self) -> &mut String {
2313 if self.rendered_opt_mut().is_none() {
2314 self.value = Some(
2315 super::clever_error::Value::Rendered(String::default()),
2316 );
2317 }
2318 self.rendered_opt_mut().unwrap()
2319 }
2320 pub fn set_rendered<T: Into<String>>(&mut self, field: T) {
2323 self.value = Some(super::clever_error::Value::Rendered(field.into().into()));
2324 }
2325 pub fn with_rendered<T: Into<String>>(mut self, field: T) -> Self {
2328 self.set_rendered(field.into());
2329 self
2330 }
2331 pub fn raw(&self) -> &[u8] {
2333 if let Some(super::clever_error::Value::Raw(field)) = &self.value {
2334 field as _
2335 } else {
2336 &[]
2337 }
2338 }
2339 pub fn raw_opt(&self) -> Option<&[u8]> {
2341 if let Some(super::clever_error::Value::Raw(field)) = &self.value {
2342 Some(field as _)
2343 } else {
2344 None
2345 }
2346 }
2347 pub fn raw_opt_mut(&mut self) -> Option<&mut ::prost::bytes::Bytes> {
2349 if let Some(super::clever_error::Value::Raw(field)) = &mut self.value {
2350 Some(field as _)
2351 } else {
2352 None
2353 }
2354 }
2355 pub fn raw_mut(&mut self) -> &mut ::prost::bytes::Bytes {
2359 if self.raw_opt_mut().is_none() {
2360 self.value = Some(
2361 super::clever_error::Value::Raw(::prost::bytes::Bytes::default()),
2362 );
2363 }
2364 self.raw_opt_mut().unwrap()
2365 }
2366 pub fn set_raw<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
2369 self.value = Some(super::clever_error::Value::Raw(field.into().into()));
2370 }
2371 pub fn with_raw<T: Into<::prost::bytes::Bytes>>(mut self, field: T) -> Self {
2374 self.set_raw(field.into());
2375 self
2376 }
2377 }
2378 impl super::CoinDenyListError {
2379 pub const fn const_default() -> Self {
2380 Self {
2381 address: None,
2382 coin_type: None,
2383 }
2384 }
2385 #[doc(hidden)]
2386 pub fn default_instance() -> &'static Self {
2387 static DEFAULT: super::CoinDenyListError = super::CoinDenyListError::const_default();
2388 &DEFAULT
2389 }
2390 pub fn address_opt_mut(&mut self) -> Option<&mut String> {
2392 self.address.as_mut().map(|field| field as _)
2393 }
2394 pub fn address_mut(&mut self) -> &mut String {
2397 self.address.get_or_insert_default()
2398 }
2399 pub fn address_opt(&self) -> Option<&str> {
2401 self.address.as_ref().map(|field| field as _)
2402 }
2403 pub fn set_address<T: Into<String>>(&mut self, field: T) {
2405 self.address = Some(field.into().into());
2406 }
2407 pub fn with_address<T: Into<String>>(mut self, field: T) -> Self {
2409 self.set_address(field.into());
2410 self
2411 }
2412 pub fn coin_type_opt_mut(&mut self) -> Option<&mut String> {
2414 self.coin_type.as_mut().map(|field| field as _)
2415 }
2416 pub fn coin_type_mut(&mut self) -> &mut String {
2419 self.coin_type.get_or_insert_default()
2420 }
2421 pub fn coin_type_opt(&self) -> Option<&str> {
2423 self.coin_type.as_ref().map(|field| field as _)
2424 }
2425 pub fn set_coin_type<T: Into<String>>(&mut self, field: T) {
2427 self.coin_type = Some(field.into().into());
2428 }
2429 pub fn with_coin_type<T: Into<String>>(mut self, field: T) -> Self {
2431 self.set_coin_type(field.into());
2432 self
2433 }
2434 }
2435 impl super::CoinMetadata {
2436 pub const fn const_default() -> Self {
2437 Self {
2438 id: None,
2439 decimals: None,
2440 name: None,
2441 symbol: None,
2442 description: None,
2443 icon_url: None,
2444 metadata_cap_id: None,
2445 metadata_cap_state: None,
2446 }
2447 }
2448 #[doc(hidden)]
2449 pub fn default_instance() -> &'static Self {
2450 static DEFAULT: super::CoinMetadata = super::CoinMetadata::const_default();
2451 &DEFAULT
2452 }
2453 pub fn id_opt_mut(&mut self) -> Option<&mut String> {
2455 self.id.as_mut().map(|field| field as _)
2456 }
2457 pub fn id_mut(&mut self) -> &mut String {
2460 self.id.get_or_insert_default()
2461 }
2462 pub fn id_opt(&self) -> Option<&str> {
2464 self.id.as_ref().map(|field| field as _)
2465 }
2466 pub fn set_id<T: Into<String>>(&mut self, field: T) {
2468 self.id = Some(field.into().into());
2469 }
2470 pub fn with_id<T: Into<String>>(mut self, field: T) -> Self {
2472 self.set_id(field.into());
2473 self
2474 }
2475 pub fn decimals_opt_mut(&mut self) -> Option<&mut u32> {
2477 self.decimals.as_mut().map(|field| field as _)
2478 }
2479 pub fn decimals_mut(&mut self) -> &mut u32 {
2482 self.decimals.get_or_insert_default()
2483 }
2484 pub fn decimals_opt(&self) -> Option<u32> {
2486 self.decimals.as_ref().map(|field| *field)
2487 }
2488 pub fn set_decimals<T: Into<u32>>(&mut self, field: T) {
2490 self.decimals = Some(field.into().into());
2491 }
2492 pub fn with_decimals<T: Into<u32>>(mut self, field: T) -> Self {
2494 self.set_decimals(field.into());
2495 self
2496 }
2497 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
2499 self.name.as_mut().map(|field| field as _)
2500 }
2501 pub fn name_mut(&mut self) -> &mut String {
2504 self.name.get_or_insert_default()
2505 }
2506 pub fn name_opt(&self) -> Option<&str> {
2508 self.name.as_ref().map(|field| field as _)
2509 }
2510 pub fn set_name<T: Into<String>>(&mut self, field: T) {
2512 self.name = Some(field.into().into());
2513 }
2514 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
2516 self.set_name(field.into());
2517 self
2518 }
2519 pub fn symbol_opt_mut(&mut self) -> Option<&mut String> {
2521 self.symbol.as_mut().map(|field| field as _)
2522 }
2523 pub fn symbol_mut(&mut self) -> &mut String {
2526 self.symbol.get_or_insert_default()
2527 }
2528 pub fn symbol_opt(&self) -> Option<&str> {
2530 self.symbol.as_ref().map(|field| field as _)
2531 }
2532 pub fn set_symbol<T: Into<String>>(&mut self, field: T) {
2534 self.symbol = Some(field.into().into());
2535 }
2536 pub fn with_symbol<T: Into<String>>(mut self, field: T) -> Self {
2538 self.set_symbol(field.into());
2539 self
2540 }
2541 pub fn description_opt_mut(&mut self) -> Option<&mut String> {
2543 self.description.as_mut().map(|field| field as _)
2544 }
2545 pub fn description_mut(&mut self) -> &mut String {
2548 self.description.get_or_insert_default()
2549 }
2550 pub fn description_opt(&self) -> Option<&str> {
2552 self.description.as_ref().map(|field| field as _)
2553 }
2554 pub fn set_description<T: Into<String>>(&mut self, field: T) {
2556 self.description = Some(field.into().into());
2557 }
2558 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
2560 self.set_description(field.into());
2561 self
2562 }
2563 pub fn icon_url_opt_mut(&mut self) -> Option<&mut String> {
2565 self.icon_url.as_mut().map(|field| field as _)
2566 }
2567 pub fn icon_url_mut(&mut self) -> &mut String {
2570 self.icon_url.get_or_insert_default()
2571 }
2572 pub fn icon_url_opt(&self) -> Option<&str> {
2574 self.icon_url.as_ref().map(|field| field as _)
2575 }
2576 pub fn set_icon_url<T: Into<String>>(&mut self, field: T) {
2578 self.icon_url = Some(field.into().into());
2579 }
2580 pub fn with_icon_url<T: Into<String>>(mut self, field: T) -> Self {
2582 self.set_icon_url(field.into());
2583 self
2584 }
2585 pub fn metadata_cap_id_opt_mut(&mut self) -> Option<&mut String> {
2587 self.metadata_cap_id.as_mut().map(|field| field as _)
2588 }
2589 pub fn metadata_cap_id_mut(&mut self) -> &mut String {
2592 self.metadata_cap_id.get_or_insert_default()
2593 }
2594 pub fn metadata_cap_id_opt(&self) -> Option<&str> {
2596 self.metadata_cap_id.as_ref().map(|field| field as _)
2597 }
2598 pub fn set_metadata_cap_id<T: Into<String>>(&mut self, field: T) {
2600 self.metadata_cap_id = Some(field.into().into());
2601 }
2602 pub fn with_metadata_cap_id<T: Into<String>>(mut self, field: T) -> Self {
2604 self.set_metadata_cap_id(field.into());
2605 self
2606 }
2607 pub fn with_metadata_cap_state<T: Into<super::coin_metadata::MetadataCapState>>(
2609 mut self,
2610 field: T,
2611 ) -> Self {
2612 self.set_metadata_cap_state(field.into());
2613 self
2614 }
2615 }
2616 impl super::CoinTreasury {
2617 pub const fn const_default() -> Self {
2618 Self {
2619 id: None,
2620 total_supply: None,
2621 supply_state: None,
2622 }
2623 }
2624 #[doc(hidden)]
2625 pub fn default_instance() -> &'static Self {
2626 static DEFAULT: super::CoinTreasury = super::CoinTreasury::const_default();
2627 &DEFAULT
2628 }
2629 pub fn id_opt_mut(&mut self) -> Option<&mut String> {
2631 self.id.as_mut().map(|field| field as _)
2632 }
2633 pub fn id_mut(&mut self) -> &mut String {
2636 self.id.get_or_insert_default()
2637 }
2638 pub fn id_opt(&self) -> Option<&str> {
2640 self.id.as_ref().map(|field| field as _)
2641 }
2642 pub fn set_id<T: Into<String>>(&mut self, field: T) {
2644 self.id = Some(field.into().into());
2645 }
2646 pub fn with_id<T: Into<String>>(mut self, field: T) -> Self {
2648 self.set_id(field.into());
2649 self
2650 }
2651 pub fn total_supply_opt_mut(&mut self) -> Option<&mut u64> {
2653 self.total_supply.as_mut().map(|field| field as _)
2654 }
2655 pub fn total_supply_mut(&mut self) -> &mut u64 {
2658 self.total_supply.get_or_insert_default()
2659 }
2660 pub fn total_supply_opt(&self) -> Option<u64> {
2662 self.total_supply.as_ref().map(|field| *field)
2663 }
2664 pub fn set_total_supply<T: Into<u64>>(&mut self, field: T) {
2666 self.total_supply = Some(field.into().into());
2667 }
2668 pub fn with_total_supply<T: Into<u64>>(mut self, field: T) -> Self {
2670 self.set_total_supply(field.into());
2671 self
2672 }
2673 pub fn with_supply_state<T: Into<super::coin_treasury::SupplyState>>(
2675 mut self,
2676 field: T,
2677 ) -> Self {
2678 self.set_supply_state(field.into());
2679 self
2680 }
2681 }
2682 impl super::Command {
2683 pub const fn const_default() -> Self {
2684 Self { command: None }
2685 }
2686 #[doc(hidden)]
2687 pub fn default_instance() -> &'static Self {
2688 static DEFAULT: super::Command = super::Command::const_default();
2689 &DEFAULT
2690 }
2691 pub fn move_call(&self) -> &super::MoveCall {
2693 if let Some(super::command::Command::MoveCall(field)) = &self.command {
2694 field as _
2695 } else {
2696 super::MoveCall::default_instance() as _
2697 }
2698 }
2699 pub fn move_call_opt(&self) -> Option<&super::MoveCall> {
2701 if let Some(super::command::Command::MoveCall(field)) = &self.command {
2702 Some(field as _)
2703 } else {
2704 None
2705 }
2706 }
2707 pub fn move_call_opt_mut(&mut self) -> Option<&mut super::MoveCall> {
2709 if let Some(super::command::Command::MoveCall(field)) = &mut self.command {
2710 Some(field as _)
2711 } else {
2712 None
2713 }
2714 }
2715 pub fn move_call_mut(&mut self) -> &mut super::MoveCall {
2719 if self.move_call_opt_mut().is_none() {
2720 self.command = Some(
2721 super::command::Command::MoveCall(super::MoveCall::default()),
2722 );
2723 }
2724 self.move_call_opt_mut().unwrap()
2725 }
2726 pub fn set_move_call<T: Into<super::MoveCall>>(&mut self, field: T) {
2729 self.command = Some(super::command::Command::MoveCall(field.into().into()));
2730 }
2731 pub fn with_move_call<T: Into<super::MoveCall>>(mut self, field: T) -> Self {
2734 self.set_move_call(field.into());
2735 self
2736 }
2737 pub fn transfer_objects(&self) -> &super::TransferObjects {
2739 if let Some(super::command::Command::TransferObjects(field)) = &self.command
2740 {
2741 field as _
2742 } else {
2743 super::TransferObjects::default_instance() as _
2744 }
2745 }
2746 pub fn transfer_objects_opt(&self) -> Option<&super::TransferObjects> {
2748 if let Some(super::command::Command::TransferObjects(field)) = &self.command
2749 {
2750 Some(field as _)
2751 } else {
2752 None
2753 }
2754 }
2755 pub fn transfer_objects_opt_mut(
2757 &mut self,
2758 ) -> Option<&mut super::TransferObjects> {
2759 if let Some(super::command::Command::TransferObjects(field)) = &mut self
2760 .command
2761 {
2762 Some(field as _)
2763 } else {
2764 None
2765 }
2766 }
2767 pub fn transfer_objects_mut(&mut self) -> &mut super::TransferObjects {
2771 if self.transfer_objects_opt_mut().is_none() {
2772 self.command = Some(
2773 super::command::Command::TransferObjects(
2774 super::TransferObjects::default(),
2775 ),
2776 );
2777 }
2778 self.transfer_objects_opt_mut().unwrap()
2779 }
2780 pub fn set_transfer_objects<T: Into<super::TransferObjects>>(
2783 &mut self,
2784 field: T,
2785 ) {
2786 self.command = Some(
2787 super::command::Command::TransferObjects(field.into().into()),
2788 );
2789 }
2790 pub fn with_transfer_objects<T: Into<super::TransferObjects>>(
2793 mut self,
2794 field: T,
2795 ) -> Self {
2796 self.set_transfer_objects(field.into());
2797 self
2798 }
2799 pub fn split_coins(&self) -> &super::SplitCoins {
2801 if let Some(super::command::Command::SplitCoins(field)) = &self.command {
2802 field as _
2803 } else {
2804 super::SplitCoins::default_instance() as _
2805 }
2806 }
2807 pub fn split_coins_opt(&self) -> Option<&super::SplitCoins> {
2809 if let Some(super::command::Command::SplitCoins(field)) = &self.command {
2810 Some(field as _)
2811 } else {
2812 None
2813 }
2814 }
2815 pub fn split_coins_opt_mut(&mut self) -> Option<&mut super::SplitCoins> {
2817 if let Some(super::command::Command::SplitCoins(field)) = &mut self.command {
2818 Some(field as _)
2819 } else {
2820 None
2821 }
2822 }
2823 pub fn split_coins_mut(&mut self) -> &mut super::SplitCoins {
2827 if self.split_coins_opt_mut().is_none() {
2828 self.command = Some(
2829 super::command::Command::SplitCoins(super::SplitCoins::default()),
2830 );
2831 }
2832 self.split_coins_opt_mut().unwrap()
2833 }
2834 pub fn set_split_coins<T: Into<super::SplitCoins>>(&mut self, field: T) {
2837 self.command = Some(
2838 super::command::Command::SplitCoins(field.into().into()),
2839 );
2840 }
2841 pub fn with_split_coins<T: Into<super::SplitCoins>>(mut self, field: T) -> Self {
2844 self.set_split_coins(field.into());
2845 self
2846 }
2847 pub fn merge_coins(&self) -> &super::MergeCoins {
2849 if let Some(super::command::Command::MergeCoins(field)) = &self.command {
2850 field as _
2851 } else {
2852 super::MergeCoins::default_instance() as _
2853 }
2854 }
2855 pub fn merge_coins_opt(&self) -> Option<&super::MergeCoins> {
2857 if let Some(super::command::Command::MergeCoins(field)) = &self.command {
2858 Some(field as _)
2859 } else {
2860 None
2861 }
2862 }
2863 pub fn merge_coins_opt_mut(&mut self) -> Option<&mut super::MergeCoins> {
2865 if let Some(super::command::Command::MergeCoins(field)) = &mut self.command {
2866 Some(field as _)
2867 } else {
2868 None
2869 }
2870 }
2871 pub fn merge_coins_mut(&mut self) -> &mut super::MergeCoins {
2875 if self.merge_coins_opt_mut().is_none() {
2876 self.command = Some(
2877 super::command::Command::MergeCoins(super::MergeCoins::default()),
2878 );
2879 }
2880 self.merge_coins_opt_mut().unwrap()
2881 }
2882 pub fn set_merge_coins<T: Into<super::MergeCoins>>(&mut self, field: T) {
2885 self.command = Some(
2886 super::command::Command::MergeCoins(field.into().into()),
2887 );
2888 }
2889 pub fn with_merge_coins<T: Into<super::MergeCoins>>(mut self, field: T) -> Self {
2892 self.set_merge_coins(field.into());
2893 self
2894 }
2895 pub fn publish(&self) -> &super::Publish {
2897 if let Some(super::command::Command::Publish(field)) = &self.command {
2898 field as _
2899 } else {
2900 super::Publish::default_instance() as _
2901 }
2902 }
2903 pub fn publish_opt(&self) -> Option<&super::Publish> {
2905 if let Some(super::command::Command::Publish(field)) = &self.command {
2906 Some(field as _)
2907 } else {
2908 None
2909 }
2910 }
2911 pub fn publish_opt_mut(&mut self) -> Option<&mut super::Publish> {
2913 if let Some(super::command::Command::Publish(field)) = &mut self.command {
2914 Some(field as _)
2915 } else {
2916 None
2917 }
2918 }
2919 pub fn publish_mut(&mut self) -> &mut super::Publish {
2923 if self.publish_opt_mut().is_none() {
2924 self.command = Some(
2925 super::command::Command::Publish(super::Publish::default()),
2926 );
2927 }
2928 self.publish_opt_mut().unwrap()
2929 }
2930 pub fn set_publish<T: Into<super::Publish>>(&mut self, field: T) {
2933 self.command = Some(super::command::Command::Publish(field.into().into()));
2934 }
2935 pub fn with_publish<T: Into<super::Publish>>(mut self, field: T) -> Self {
2938 self.set_publish(field.into());
2939 self
2940 }
2941 pub fn make_move_vector(&self) -> &super::MakeMoveVector {
2943 if let Some(super::command::Command::MakeMoveVector(field)) = &self.command {
2944 field as _
2945 } else {
2946 super::MakeMoveVector::default_instance() as _
2947 }
2948 }
2949 pub fn make_move_vector_opt(&self) -> Option<&super::MakeMoveVector> {
2951 if let Some(super::command::Command::MakeMoveVector(field)) = &self.command {
2952 Some(field as _)
2953 } else {
2954 None
2955 }
2956 }
2957 pub fn make_move_vector_opt_mut(
2959 &mut self,
2960 ) -> Option<&mut super::MakeMoveVector> {
2961 if let Some(super::command::Command::MakeMoveVector(field)) = &mut self
2962 .command
2963 {
2964 Some(field as _)
2965 } else {
2966 None
2967 }
2968 }
2969 pub fn make_move_vector_mut(&mut self) -> &mut super::MakeMoveVector {
2973 if self.make_move_vector_opt_mut().is_none() {
2974 self.command = Some(
2975 super::command::Command::MakeMoveVector(
2976 super::MakeMoveVector::default(),
2977 ),
2978 );
2979 }
2980 self.make_move_vector_opt_mut().unwrap()
2981 }
2982 pub fn set_make_move_vector<T: Into<super::MakeMoveVector>>(
2985 &mut self,
2986 field: T,
2987 ) {
2988 self.command = Some(
2989 super::command::Command::MakeMoveVector(field.into().into()),
2990 );
2991 }
2992 pub fn with_make_move_vector<T: Into<super::MakeMoveVector>>(
2995 mut self,
2996 field: T,
2997 ) -> Self {
2998 self.set_make_move_vector(field.into());
2999 self
3000 }
3001 pub fn upgrade(&self) -> &super::Upgrade {
3003 if let Some(super::command::Command::Upgrade(field)) = &self.command {
3004 field as _
3005 } else {
3006 super::Upgrade::default_instance() as _
3007 }
3008 }
3009 pub fn upgrade_opt(&self) -> Option<&super::Upgrade> {
3011 if let Some(super::command::Command::Upgrade(field)) = &self.command {
3012 Some(field as _)
3013 } else {
3014 None
3015 }
3016 }
3017 pub fn upgrade_opt_mut(&mut self) -> Option<&mut super::Upgrade> {
3019 if let Some(super::command::Command::Upgrade(field)) = &mut self.command {
3020 Some(field as _)
3021 } else {
3022 None
3023 }
3024 }
3025 pub fn upgrade_mut(&mut self) -> &mut super::Upgrade {
3029 if self.upgrade_opt_mut().is_none() {
3030 self.command = Some(
3031 super::command::Command::Upgrade(super::Upgrade::default()),
3032 );
3033 }
3034 self.upgrade_opt_mut().unwrap()
3035 }
3036 pub fn set_upgrade<T: Into<super::Upgrade>>(&mut self, field: T) {
3039 self.command = Some(super::command::Command::Upgrade(field.into().into()));
3040 }
3041 pub fn with_upgrade<T: Into<super::Upgrade>>(mut self, field: T) -> Self {
3044 self.set_upgrade(field.into());
3045 self
3046 }
3047 }
3048 impl super::CommandArgumentError {
3049 pub const fn const_default() -> Self {
3050 Self {
3051 argument: None,
3052 kind: None,
3053 index_error: None,
3054 }
3055 }
3056 #[doc(hidden)]
3057 pub fn default_instance() -> &'static Self {
3058 static DEFAULT: super::CommandArgumentError = super::CommandArgumentError::const_default();
3059 &DEFAULT
3060 }
3061 pub fn argument_opt_mut(&mut self) -> Option<&mut u32> {
3063 self.argument.as_mut().map(|field| field as _)
3064 }
3065 pub fn argument_mut(&mut self) -> &mut u32 {
3068 self.argument.get_or_insert_default()
3069 }
3070 pub fn argument_opt(&self) -> Option<u32> {
3072 self.argument.as_ref().map(|field| *field)
3073 }
3074 pub fn set_argument<T: Into<u32>>(&mut self, field: T) {
3076 self.argument = Some(field.into().into());
3077 }
3078 pub fn with_argument<T: Into<u32>>(mut self, field: T) -> Self {
3080 self.set_argument(field.into());
3081 self
3082 }
3083 pub fn with_kind<
3085 T: Into<super::command_argument_error::CommandArgumentErrorKind>,
3086 >(mut self, field: T) -> Self {
3087 self.set_kind(field.into());
3088 self
3089 }
3090 pub fn index_error(&self) -> &super::IndexError {
3092 self.index_error
3093 .as_ref()
3094 .map(|field| field as _)
3095 .unwrap_or_else(|| super::IndexError::default_instance() as _)
3096 }
3097 pub fn index_error_opt_mut(&mut self) -> Option<&mut super::IndexError> {
3099 self.index_error.as_mut().map(|field| field as _)
3100 }
3101 pub fn index_error_mut(&mut self) -> &mut super::IndexError {
3104 self.index_error.get_or_insert_default()
3105 }
3106 pub fn index_error_opt(&self) -> Option<&super::IndexError> {
3108 self.index_error.as_ref().map(|field| field as _)
3109 }
3110 pub fn set_index_error<T: Into<super::IndexError>>(&mut self, field: T) {
3112 self.index_error = Some(field.into().into());
3113 }
3114 pub fn with_index_error<T: Into<super::IndexError>>(mut self, field: T) -> Self {
3116 self.set_index_error(field.into());
3117 self
3118 }
3119 }
3120 impl super::CommandOutput {
3121 pub const fn const_default() -> Self {
3122 Self {
3123 argument: None,
3124 value: None,
3125 json: None,
3126 }
3127 }
3128 #[doc(hidden)]
3129 pub fn default_instance() -> &'static Self {
3130 static DEFAULT: super::CommandOutput = super::CommandOutput::const_default();
3131 &DEFAULT
3132 }
3133 pub fn argument(&self) -> &super::Argument {
3135 self.argument
3136 .as_ref()
3137 .map(|field| field as _)
3138 .unwrap_or_else(|| super::Argument::default_instance() as _)
3139 }
3140 pub fn argument_opt_mut(&mut self) -> Option<&mut super::Argument> {
3142 self.argument.as_mut().map(|field| field as _)
3143 }
3144 pub fn argument_mut(&mut self) -> &mut super::Argument {
3147 self.argument.get_or_insert_default()
3148 }
3149 pub fn argument_opt(&self) -> Option<&super::Argument> {
3151 self.argument.as_ref().map(|field| field as _)
3152 }
3153 pub fn set_argument<T: Into<super::Argument>>(&mut self, field: T) {
3155 self.argument = Some(field.into().into());
3156 }
3157 pub fn with_argument<T: Into<super::Argument>>(mut self, field: T) -> Self {
3159 self.set_argument(field.into());
3160 self
3161 }
3162 pub fn value(&self) -> &super::Bcs {
3164 self.value
3165 .as_ref()
3166 .map(|field| field as _)
3167 .unwrap_or_else(|| super::Bcs::default_instance() as _)
3168 }
3169 pub fn value_opt_mut(&mut self) -> Option<&mut super::Bcs> {
3171 self.value.as_mut().map(|field| field as _)
3172 }
3173 pub fn value_mut(&mut self) -> &mut super::Bcs {
3176 self.value.get_or_insert_default()
3177 }
3178 pub fn value_opt(&self) -> Option<&super::Bcs> {
3180 self.value.as_ref().map(|field| field as _)
3181 }
3182 pub fn set_value<T: Into<super::Bcs>>(&mut self, field: T) {
3184 self.value = Some(field.into().into());
3185 }
3186 pub fn with_value<T: Into<super::Bcs>>(mut self, field: T) -> Self {
3188 self.set_value(field.into());
3189 self
3190 }
3191 pub fn json_opt_mut(&mut self) -> Option<&mut ::prost_types::Value> {
3193 self.json.as_mut().map(|field| field as _)
3194 }
3195 pub fn json_mut(&mut self) -> &mut ::prost_types::Value {
3198 self.json.get_or_insert_default()
3199 }
3200 pub fn json_opt(&self) -> Option<&::prost_types::Value> {
3202 self.json.as_ref().map(|field| field as _)
3203 }
3204 pub fn set_json<T: Into<::prost_types::Value>>(&mut self, field: T) {
3206 self.json = Some(field.into().into());
3207 }
3208 pub fn with_json<T: Into<::prost_types::Value>>(mut self, field: T) -> Self {
3210 self.set_json(field.into());
3211 self
3212 }
3213 }
3214 impl super::CommandResult {
3215 pub const fn const_default() -> Self {
3216 Self {
3217 return_values: Vec::new(),
3218 mutated_by_ref: Vec::new(),
3219 }
3220 }
3221 #[doc(hidden)]
3222 pub fn default_instance() -> &'static Self {
3223 static DEFAULT: super::CommandResult = super::CommandResult::const_default();
3224 &DEFAULT
3225 }
3226 pub fn return_values(&self) -> &[super::CommandOutput] {
3228 &self.return_values
3229 }
3230 pub fn return_values_mut(&mut self) -> &mut Vec<super::CommandOutput> {
3233 &mut self.return_values
3234 }
3235 pub fn set_return_values(&mut self, field: Vec<super::CommandOutput>) {
3237 self.return_values = field;
3238 }
3239 pub fn with_return_values(mut self, field: Vec<super::CommandOutput>) -> Self {
3241 self.set_return_values(field);
3242 self
3243 }
3244 pub fn mutated_by_ref(&self) -> &[super::CommandOutput] {
3246 &self.mutated_by_ref
3247 }
3248 pub fn mutated_by_ref_mut(&mut self) -> &mut Vec<super::CommandOutput> {
3251 &mut self.mutated_by_ref
3252 }
3253 pub fn set_mutated_by_ref(&mut self, field: Vec<super::CommandOutput>) {
3255 self.mutated_by_ref = field;
3256 }
3257 pub fn with_mutated_by_ref(mut self, field: Vec<super::CommandOutput>) -> Self {
3259 self.set_mutated_by_ref(field);
3260 self
3261 }
3262 }
3263 impl super::CongestedObjects {
3264 pub const fn const_default() -> Self {
3265 Self { objects: Vec::new() }
3266 }
3267 #[doc(hidden)]
3268 pub fn default_instance() -> &'static Self {
3269 static DEFAULT: super::CongestedObjects = super::CongestedObjects::const_default();
3270 &DEFAULT
3271 }
3272 pub fn objects(&self) -> &[String] {
3274 &self.objects
3275 }
3276 pub fn objects_mut(&mut self) -> &mut Vec<String> {
3279 &mut self.objects
3280 }
3281 pub fn set_objects(&mut self, field: Vec<String>) {
3283 self.objects = field;
3284 }
3285 pub fn with_objects(mut self, field: Vec<String>) -> Self {
3287 self.set_objects(field);
3288 self
3289 }
3290 }
3291 impl super::ConsensusCommitPrologue {
3292 pub const fn const_default() -> Self {
3293 Self {
3294 epoch: None,
3295 round: None,
3296 commit_timestamp: None,
3297 consensus_commit_digest: None,
3298 sub_dag_index: None,
3299 consensus_determined_version_assignments: None,
3300 additional_state_digest: None,
3301 }
3302 }
3303 #[doc(hidden)]
3304 pub fn default_instance() -> &'static Self {
3305 static DEFAULT: super::ConsensusCommitPrologue = super::ConsensusCommitPrologue::const_default();
3306 &DEFAULT
3307 }
3308 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
3310 self.epoch.as_mut().map(|field| field as _)
3311 }
3312 pub fn epoch_mut(&mut self) -> &mut u64 {
3315 self.epoch.get_or_insert_default()
3316 }
3317 pub fn epoch_opt(&self) -> Option<u64> {
3319 self.epoch.as_ref().map(|field| *field)
3320 }
3321 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
3323 self.epoch = Some(field.into().into());
3324 }
3325 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
3327 self.set_epoch(field.into());
3328 self
3329 }
3330 pub fn round_opt_mut(&mut self) -> Option<&mut u64> {
3332 self.round.as_mut().map(|field| field as _)
3333 }
3334 pub fn round_mut(&mut self) -> &mut u64 {
3337 self.round.get_or_insert_default()
3338 }
3339 pub fn round_opt(&self) -> Option<u64> {
3341 self.round.as_ref().map(|field| *field)
3342 }
3343 pub fn set_round<T: Into<u64>>(&mut self, field: T) {
3345 self.round = Some(field.into().into());
3346 }
3347 pub fn with_round<T: Into<u64>>(mut self, field: T) -> Self {
3349 self.set_round(field.into());
3350 self
3351 }
3352 pub fn commit_timestamp_opt_mut(
3354 &mut self,
3355 ) -> Option<&mut ::prost_types::Timestamp> {
3356 self.commit_timestamp.as_mut().map(|field| field as _)
3357 }
3358 pub fn commit_timestamp_mut(&mut self) -> &mut ::prost_types::Timestamp {
3361 self.commit_timestamp.get_or_insert_default()
3362 }
3363 pub fn commit_timestamp_opt(&self) -> Option<&::prost_types::Timestamp> {
3365 self.commit_timestamp.as_ref().map(|field| field as _)
3366 }
3367 pub fn set_commit_timestamp<T: Into<::prost_types::Timestamp>>(
3369 &mut self,
3370 field: T,
3371 ) {
3372 self.commit_timestamp = Some(field.into().into());
3373 }
3374 pub fn with_commit_timestamp<T: Into<::prost_types::Timestamp>>(
3376 mut self,
3377 field: T,
3378 ) -> Self {
3379 self.set_commit_timestamp(field.into());
3380 self
3381 }
3382 pub fn consensus_commit_digest_opt_mut(&mut self) -> Option<&mut String> {
3384 self.consensus_commit_digest.as_mut().map(|field| field as _)
3385 }
3386 pub fn consensus_commit_digest_mut(&mut self) -> &mut String {
3389 self.consensus_commit_digest.get_or_insert_default()
3390 }
3391 pub fn consensus_commit_digest_opt(&self) -> Option<&str> {
3393 self.consensus_commit_digest.as_ref().map(|field| field as _)
3394 }
3395 pub fn set_consensus_commit_digest<T: Into<String>>(&mut self, field: T) {
3397 self.consensus_commit_digest = Some(field.into().into());
3398 }
3399 pub fn with_consensus_commit_digest<T: Into<String>>(
3401 mut self,
3402 field: T,
3403 ) -> Self {
3404 self.set_consensus_commit_digest(field.into());
3405 self
3406 }
3407 pub fn sub_dag_index_opt_mut(&mut self) -> Option<&mut u64> {
3409 self.sub_dag_index.as_mut().map(|field| field as _)
3410 }
3411 pub fn sub_dag_index_mut(&mut self) -> &mut u64 {
3414 self.sub_dag_index.get_or_insert_default()
3415 }
3416 pub fn sub_dag_index_opt(&self) -> Option<u64> {
3418 self.sub_dag_index.as_ref().map(|field| *field)
3419 }
3420 pub fn set_sub_dag_index<T: Into<u64>>(&mut self, field: T) {
3422 self.sub_dag_index = Some(field.into().into());
3423 }
3424 pub fn with_sub_dag_index<T: Into<u64>>(mut self, field: T) -> Self {
3426 self.set_sub_dag_index(field.into());
3427 self
3428 }
3429 pub fn consensus_determined_version_assignments(
3431 &self,
3432 ) -> &super::ConsensusDeterminedVersionAssignments {
3433 self.consensus_determined_version_assignments
3434 .as_ref()
3435 .map(|field| field as _)
3436 .unwrap_or_else(|| {
3437 super::ConsensusDeterminedVersionAssignments::default_instance() as _
3438 })
3439 }
3440 pub fn consensus_determined_version_assignments_opt_mut(
3442 &mut self,
3443 ) -> Option<&mut super::ConsensusDeterminedVersionAssignments> {
3444 self.consensus_determined_version_assignments
3445 .as_mut()
3446 .map(|field| field as _)
3447 }
3448 pub fn consensus_determined_version_assignments_mut(
3451 &mut self,
3452 ) -> &mut super::ConsensusDeterminedVersionAssignments {
3453 self.consensus_determined_version_assignments.get_or_insert_default()
3454 }
3455 pub fn consensus_determined_version_assignments_opt(
3457 &self,
3458 ) -> Option<&super::ConsensusDeterminedVersionAssignments> {
3459 self.consensus_determined_version_assignments
3460 .as_ref()
3461 .map(|field| field as _)
3462 }
3463 pub fn set_consensus_determined_version_assignments<
3465 T: Into<super::ConsensusDeterminedVersionAssignments>,
3466 >(&mut self, field: T) {
3467 self.consensus_determined_version_assignments = Some(field.into().into());
3468 }
3469 pub fn with_consensus_determined_version_assignments<
3471 T: Into<super::ConsensusDeterminedVersionAssignments>,
3472 >(mut self, field: T) -> Self {
3473 self.set_consensus_determined_version_assignments(field.into());
3474 self
3475 }
3476 pub fn additional_state_digest_opt_mut(&mut self) -> Option<&mut String> {
3478 self.additional_state_digest.as_mut().map(|field| field as _)
3479 }
3480 pub fn additional_state_digest_mut(&mut self) -> &mut String {
3483 self.additional_state_digest.get_or_insert_default()
3484 }
3485 pub fn additional_state_digest_opt(&self) -> Option<&str> {
3487 self.additional_state_digest.as_ref().map(|field| field as _)
3488 }
3489 pub fn set_additional_state_digest<T: Into<String>>(&mut self, field: T) {
3491 self.additional_state_digest = Some(field.into().into());
3492 }
3493 pub fn with_additional_state_digest<T: Into<String>>(
3495 mut self,
3496 field: T,
3497 ) -> Self {
3498 self.set_additional_state_digest(field.into());
3499 self
3500 }
3501 }
3502 impl super::ConsensusDeterminedVersionAssignments {
3503 pub const fn const_default() -> Self {
3504 Self {
3505 version: None,
3506 canceled_transactions: Vec::new(),
3507 }
3508 }
3509 #[doc(hidden)]
3510 pub fn default_instance() -> &'static Self {
3511 static DEFAULT: super::ConsensusDeterminedVersionAssignments = super::ConsensusDeterminedVersionAssignments::const_default();
3512 &DEFAULT
3513 }
3514 pub fn version_opt_mut(&mut self) -> Option<&mut i32> {
3516 self.version.as_mut().map(|field| field as _)
3517 }
3518 pub fn version_mut(&mut self) -> &mut i32 {
3521 self.version.get_or_insert_default()
3522 }
3523 pub fn version_opt(&self) -> Option<i32> {
3525 self.version.as_ref().map(|field| *field)
3526 }
3527 pub fn set_version<T: Into<i32>>(&mut self, field: T) {
3529 self.version = Some(field.into().into());
3530 }
3531 pub fn with_version<T: Into<i32>>(mut self, field: T) -> Self {
3533 self.set_version(field.into());
3534 self
3535 }
3536 pub fn canceled_transactions(&self) -> &[super::CanceledTransaction] {
3538 &self.canceled_transactions
3539 }
3540 pub fn canceled_transactions_mut(
3543 &mut self,
3544 ) -> &mut Vec<super::CanceledTransaction> {
3545 &mut self.canceled_transactions
3546 }
3547 pub fn set_canceled_transactions(
3549 &mut self,
3550 field: Vec<super::CanceledTransaction>,
3551 ) {
3552 self.canceled_transactions = field;
3553 }
3554 pub fn with_canceled_transactions(
3556 mut self,
3557 field: Vec<super::CanceledTransaction>,
3558 ) -> Self {
3559 self.set_canceled_transactions(field);
3560 self
3561 }
3562 }
3563 impl super::DatatypeDescriptor {
3564 pub const fn const_default() -> Self {
3565 Self {
3566 type_name: None,
3567 defining_id: None,
3568 module: None,
3569 name: None,
3570 abilities: Vec::new(),
3571 type_parameters: Vec::new(),
3572 kind: None,
3573 fields: Vec::new(),
3574 variants: Vec::new(),
3575 }
3576 }
3577 #[doc(hidden)]
3578 pub fn default_instance() -> &'static Self {
3579 static DEFAULT: super::DatatypeDescriptor = super::DatatypeDescriptor::const_default();
3580 &DEFAULT
3581 }
3582 pub fn type_name_opt_mut(&mut self) -> Option<&mut String> {
3584 self.type_name.as_mut().map(|field| field as _)
3585 }
3586 pub fn type_name_mut(&mut self) -> &mut String {
3589 self.type_name.get_or_insert_default()
3590 }
3591 pub fn type_name_opt(&self) -> Option<&str> {
3593 self.type_name.as_ref().map(|field| field as _)
3594 }
3595 pub fn set_type_name<T: Into<String>>(&mut self, field: T) {
3597 self.type_name = Some(field.into().into());
3598 }
3599 pub fn with_type_name<T: Into<String>>(mut self, field: T) -> Self {
3601 self.set_type_name(field.into());
3602 self
3603 }
3604 pub fn defining_id_opt_mut(&mut self) -> Option<&mut String> {
3606 self.defining_id.as_mut().map(|field| field as _)
3607 }
3608 pub fn defining_id_mut(&mut self) -> &mut String {
3611 self.defining_id.get_or_insert_default()
3612 }
3613 pub fn defining_id_opt(&self) -> Option<&str> {
3615 self.defining_id.as_ref().map(|field| field as _)
3616 }
3617 pub fn set_defining_id<T: Into<String>>(&mut self, field: T) {
3619 self.defining_id = Some(field.into().into());
3620 }
3621 pub fn with_defining_id<T: Into<String>>(mut self, field: T) -> Self {
3623 self.set_defining_id(field.into());
3624 self
3625 }
3626 pub fn module_opt_mut(&mut self) -> Option<&mut String> {
3628 self.module.as_mut().map(|field| field as _)
3629 }
3630 pub fn module_mut(&mut self) -> &mut String {
3633 self.module.get_or_insert_default()
3634 }
3635 pub fn module_opt(&self) -> Option<&str> {
3637 self.module.as_ref().map(|field| field as _)
3638 }
3639 pub fn set_module<T: Into<String>>(&mut self, field: T) {
3641 self.module = Some(field.into().into());
3642 }
3643 pub fn with_module<T: Into<String>>(mut self, field: T) -> Self {
3645 self.set_module(field.into());
3646 self
3647 }
3648 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
3650 self.name.as_mut().map(|field| field as _)
3651 }
3652 pub fn name_mut(&mut self) -> &mut String {
3655 self.name.get_or_insert_default()
3656 }
3657 pub fn name_opt(&self) -> Option<&str> {
3659 self.name.as_ref().map(|field| field as _)
3660 }
3661 pub fn set_name<T: Into<String>>(&mut self, field: T) {
3663 self.name = Some(field.into().into());
3664 }
3665 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
3667 self.set_name(field.into());
3668 self
3669 }
3670 pub fn type_parameters(&self) -> &[super::TypeParameter] {
3672 &self.type_parameters
3673 }
3674 pub fn type_parameters_mut(&mut self) -> &mut Vec<super::TypeParameter> {
3677 &mut self.type_parameters
3678 }
3679 pub fn set_type_parameters(&mut self, field: Vec<super::TypeParameter>) {
3681 self.type_parameters = field;
3682 }
3683 pub fn with_type_parameters(mut self, field: Vec<super::TypeParameter>) -> Self {
3685 self.set_type_parameters(field);
3686 self
3687 }
3688 pub fn with_kind<T: Into<super::datatype_descriptor::DatatypeKind>>(
3690 mut self,
3691 field: T,
3692 ) -> Self {
3693 self.set_kind(field.into());
3694 self
3695 }
3696 pub fn fields(&self) -> &[super::FieldDescriptor] {
3698 &self.fields
3699 }
3700 pub fn fields_mut(&mut self) -> &mut Vec<super::FieldDescriptor> {
3703 &mut self.fields
3704 }
3705 pub fn set_fields(&mut self, field: Vec<super::FieldDescriptor>) {
3707 self.fields = field;
3708 }
3709 pub fn with_fields(mut self, field: Vec<super::FieldDescriptor>) -> Self {
3711 self.set_fields(field);
3712 self
3713 }
3714 pub fn variants(&self) -> &[super::VariantDescriptor] {
3716 &self.variants
3717 }
3718 pub fn variants_mut(&mut self) -> &mut Vec<super::VariantDescriptor> {
3721 &mut self.variants
3722 }
3723 pub fn set_variants(&mut self, field: Vec<super::VariantDescriptor>) {
3725 self.variants = field;
3726 }
3727 pub fn with_variants(mut self, field: Vec<super::VariantDescriptor>) -> Self {
3729 self.set_variants(field);
3730 self
3731 }
3732 }
3733 impl super::DynamicField {
3734 pub const fn const_default() -> Self {
3735 Self {
3736 kind: None,
3737 parent: None,
3738 field_id: None,
3739 name_type: None,
3740 name_value: None,
3741 value_type: None,
3742 dynamic_object_id: None,
3743 object: None,
3744 }
3745 }
3746 #[doc(hidden)]
3747 pub fn default_instance() -> &'static Self {
3748 static DEFAULT: super::DynamicField = super::DynamicField::const_default();
3749 &DEFAULT
3750 }
3751 pub fn with_kind<T: Into<super::dynamic_field::DynamicFieldKind>>(
3753 mut self,
3754 field: T,
3755 ) -> Self {
3756 self.set_kind(field.into());
3757 self
3758 }
3759 pub fn parent_opt_mut(&mut self) -> Option<&mut String> {
3761 self.parent.as_mut().map(|field| field as _)
3762 }
3763 pub fn parent_mut(&mut self) -> &mut String {
3766 self.parent.get_or_insert_default()
3767 }
3768 pub fn parent_opt(&self) -> Option<&str> {
3770 self.parent.as_ref().map(|field| field as _)
3771 }
3772 pub fn set_parent<T: Into<String>>(&mut self, field: T) {
3774 self.parent = Some(field.into().into());
3775 }
3776 pub fn with_parent<T: Into<String>>(mut self, field: T) -> Self {
3778 self.set_parent(field.into());
3779 self
3780 }
3781 pub fn field_id_opt_mut(&mut self) -> Option<&mut String> {
3783 self.field_id.as_mut().map(|field| field as _)
3784 }
3785 pub fn field_id_mut(&mut self) -> &mut String {
3788 self.field_id.get_or_insert_default()
3789 }
3790 pub fn field_id_opt(&self) -> Option<&str> {
3792 self.field_id.as_ref().map(|field| field as _)
3793 }
3794 pub fn set_field_id<T: Into<String>>(&mut self, field: T) {
3796 self.field_id = Some(field.into().into());
3797 }
3798 pub fn with_field_id<T: Into<String>>(mut self, field: T) -> Self {
3800 self.set_field_id(field.into());
3801 self
3802 }
3803 pub fn name_type_opt_mut(&mut self) -> Option<&mut String> {
3805 self.name_type.as_mut().map(|field| field as _)
3806 }
3807 pub fn name_type_mut(&mut self) -> &mut String {
3810 self.name_type.get_or_insert_default()
3811 }
3812 pub fn name_type_opt(&self) -> Option<&str> {
3814 self.name_type.as_ref().map(|field| field as _)
3815 }
3816 pub fn set_name_type<T: Into<String>>(&mut self, field: T) {
3818 self.name_type = Some(field.into().into());
3819 }
3820 pub fn with_name_type<T: Into<String>>(mut self, field: T) -> Self {
3822 self.set_name_type(field.into());
3823 self
3824 }
3825 pub fn name_value_opt(&self) -> Option<&[u8]> {
3827 self.name_value.as_ref().map(|field| field as _)
3828 }
3829 pub fn set_name_value<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
3831 self.name_value = Some(field.into().into());
3832 }
3833 pub fn with_name_value<T: Into<::prost::bytes::Bytes>>(
3835 mut self,
3836 field: T,
3837 ) -> Self {
3838 self.set_name_value(field.into());
3839 self
3840 }
3841 pub fn value_type_opt_mut(&mut self) -> Option<&mut String> {
3843 self.value_type.as_mut().map(|field| field as _)
3844 }
3845 pub fn value_type_mut(&mut self) -> &mut String {
3848 self.value_type.get_or_insert_default()
3849 }
3850 pub fn value_type_opt(&self) -> Option<&str> {
3852 self.value_type.as_ref().map(|field| field as _)
3853 }
3854 pub fn set_value_type<T: Into<String>>(&mut self, field: T) {
3856 self.value_type = Some(field.into().into());
3857 }
3858 pub fn with_value_type<T: Into<String>>(mut self, field: T) -> Self {
3860 self.set_value_type(field.into());
3861 self
3862 }
3863 pub fn dynamic_object_id_opt_mut(&mut self) -> Option<&mut String> {
3865 self.dynamic_object_id.as_mut().map(|field| field as _)
3866 }
3867 pub fn dynamic_object_id_mut(&mut self) -> &mut String {
3870 self.dynamic_object_id.get_or_insert_default()
3871 }
3872 pub fn dynamic_object_id_opt(&self) -> Option<&str> {
3874 self.dynamic_object_id.as_ref().map(|field| field as _)
3875 }
3876 pub fn set_dynamic_object_id<T: Into<String>>(&mut self, field: T) {
3878 self.dynamic_object_id = Some(field.into().into());
3879 }
3880 pub fn with_dynamic_object_id<T: Into<String>>(mut self, field: T) -> Self {
3882 self.set_dynamic_object_id(field.into());
3883 self
3884 }
3885 pub fn object(&self) -> &super::Object {
3887 self.object
3888 .as_ref()
3889 .map(|field| field as _)
3890 .unwrap_or_else(|| super::Object::default_instance() as _)
3891 }
3892 pub fn object_opt_mut(&mut self) -> Option<&mut super::Object> {
3894 self.object.as_mut().map(|field| field as _)
3895 }
3896 pub fn object_mut(&mut self) -> &mut super::Object {
3899 self.object.get_or_insert_default()
3900 }
3901 pub fn object_opt(&self) -> Option<&super::Object> {
3903 self.object.as_ref().map(|field| field as _)
3904 }
3905 pub fn set_object<T: Into<super::Object>>(&mut self, field: T) {
3907 self.object = Some(field.into().into());
3908 }
3909 pub fn with_object<T: Into<super::Object>>(mut self, field: T) -> Self {
3911 self.set_object(field.into());
3912 self
3913 }
3914 }
3915 impl super::EndOfEpochData {
3916 pub const fn const_default() -> Self {
3917 Self {
3918 next_epoch_committee: Vec::new(),
3919 next_epoch_protocol_version: None,
3920 epoch_commitments: Vec::new(),
3921 }
3922 }
3923 #[doc(hidden)]
3924 pub fn default_instance() -> &'static Self {
3925 static DEFAULT: super::EndOfEpochData = super::EndOfEpochData::const_default();
3926 &DEFAULT
3927 }
3928 pub fn next_epoch_committee(&self) -> &[super::ValidatorCommitteeMember] {
3930 &self.next_epoch_committee
3931 }
3932 pub fn next_epoch_committee_mut(
3935 &mut self,
3936 ) -> &mut Vec<super::ValidatorCommitteeMember> {
3937 &mut self.next_epoch_committee
3938 }
3939 pub fn set_next_epoch_committee(
3941 &mut self,
3942 field: Vec<super::ValidatorCommitteeMember>,
3943 ) {
3944 self.next_epoch_committee = field;
3945 }
3946 pub fn with_next_epoch_committee(
3948 mut self,
3949 field: Vec<super::ValidatorCommitteeMember>,
3950 ) -> Self {
3951 self.set_next_epoch_committee(field);
3952 self
3953 }
3954 pub fn next_epoch_protocol_version_opt_mut(&mut self) -> Option<&mut u64> {
3956 self.next_epoch_protocol_version.as_mut().map(|field| field as _)
3957 }
3958 pub fn next_epoch_protocol_version_mut(&mut self) -> &mut u64 {
3961 self.next_epoch_protocol_version.get_or_insert_default()
3962 }
3963 pub fn next_epoch_protocol_version_opt(&self) -> Option<u64> {
3965 self.next_epoch_protocol_version.as_ref().map(|field| *field)
3966 }
3967 pub fn set_next_epoch_protocol_version<T: Into<u64>>(&mut self, field: T) {
3969 self.next_epoch_protocol_version = Some(field.into().into());
3970 }
3971 pub fn with_next_epoch_protocol_version<T: Into<u64>>(
3973 mut self,
3974 field: T,
3975 ) -> Self {
3976 self.set_next_epoch_protocol_version(field.into());
3977 self
3978 }
3979 pub fn epoch_commitments(&self) -> &[super::CheckpointCommitment] {
3981 &self.epoch_commitments
3982 }
3983 pub fn epoch_commitments_mut(
3986 &mut self,
3987 ) -> &mut Vec<super::CheckpointCommitment> {
3988 &mut self.epoch_commitments
3989 }
3990 pub fn set_epoch_commitments(
3992 &mut self,
3993 field: Vec<super::CheckpointCommitment>,
3994 ) {
3995 self.epoch_commitments = field;
3996 }
3997 pub fn with_epoch_commitments(
3999 mut self,
4000 field: Vec<super::CheckpointCommitment>,
4001 ) -> Self {
4002 self.set_epoch_commitments(field);
4003 self
4004 }
4005 }
4006 impl super::EndOfEpochTransaction {
4007 pub const fn const_default() -> Self {
4008 Self { transactions: Vec::new() }
4009 }
4010 #[doc(hidden)]
4011 pub fn default_instance() -> &'static Self {
4012 static DEFAULT: super::EndOfEpochTransaction = super::EndOfEpochTransaction::const_default();
4013 &DEFAULT
4014 }
4015 pub fn transactions(&self) -> &[super::EndOfEpochTransactionKind] {
4017 &self.transactions
4018 }
4019 pub fn transactions_mut(
4022 &mut self,
4023 ) -> &mut Vec<super::EndOfEpochTransactionKind> {
4024 &mut self.transactions
4025 }
4026 pub fn set_transactions(
4028 &mut self,
4029 field: Vec<super::EndOfEpochTransactionKind>,
4030 ) {
4031 self.transactions = field;
4032 }
4033 pub fn with_transactions(
4035 mut self,
4036 field: Vec<super::EndOfEpochTransactionKind>,
4037 ) -> Self {
4038 self.set_transactions(field);
4039 self
4040 }
4041 }
4042 impl super::EndOfEpochTransactionKind {
4043 pub const fn const_default() -> Self {
4044 Self { kind: None }
4045 }
4046 #[doc(hidden)]
4047 pub fn default_instance() -> &'static Self {
4048 static DEFAULT: super::EndOfEpochTransactionKind = super::EndOfEpochTransactionKind::const_default();
4049 &DEFAULT
4050 }
4051 pub fn change_epoch(&self) -> &super::ChangeEpoch {
4053 if let Some(
4054 super::end_of_epoch_transaction_kind::Kind::ChangeEpoch(field),
4055 ) = &self.kind
4056 {
4057 field as _
4058 } else {
4059 super::ChangeEpoch::default_instance() as _
4060 }
4061 }
4062 pub fn change_epoch_opt(&self) -> Option<&super::ChangeEpoch> {
4064 if let Some(
4065 super::end_of_epoch_transaction_kind::Kind::ChangeEpoch(field),
4066 ) = &self.kind
4067 {
4068 Some(field as _)
4069 } else {
4070 None
4071 }
4072 }
4073 pub fn change_epoch_opt_mut(&mut self) -> Option<&mut super::ChangeEpoch> {
4075 if let Some(
4076 super::end_of_epoch_transaction_kind::Kind::ChangeEpoch(field),
4077 ) = &mut self.kind
4078 {
4079 Some(field as _)
4080 } else {
4081 None
4082 }
4083 }
4084 pub fn change_epoch_mut(&mut self) -> &mut super::ChangeEpoch {
4088 if self.change_epoch_opt_mut().is_none() {
4089 self.kind = Some(
4090 super::end_of_epoch_transaction_kind::Kind::ChangeEpoch(
4091 super::ChangeEpoch::default(),
4092 ),
4093 );
4094 }
4095 self.change_epoch_opt_mut().unwrap()
4096 }
4097 pub fn set_change_epoch<T: Into<super::ChangeEpoch>>(&mut self, field: T) {
4100 self.kind = Some(
4101 super::end_of_epoch_transaction_kind::Kind::ChangeEpoch(
4102 field.into().into(),
4103 ),
4104 );
4105 }
4106 pub fn with_change_epoch<T: Into<super::ChangeEpoch>>(
4109 mut self,
4110 field: T,
4111 ) -> Self {
4112 self.set_change_epoch(field.into());
4113 self
4114 }
4115 pub fn authenticator_state_expire(&self) -> &super::AuthenticatorStateExpire {
4117 if let Some(
4118 super::end_of_epoch_transaction_kind::Kind::AuthenticatorStateExpire(
4119 field,
4120 ),
4121 ) = &self.kind
4122 {
4123 field as _
4124 } else {
4125 super::AuthenticatorStateExpire::default_instance() as _
4126 }
4127 }
4128 pub fn authenticator_state_expire_opt(
4130 &self,
4131 ) -> Option<&super::AuthenticatorStateExpire> {
4132 if let Some(
4133 super::end_of_epoch_transaction_kind::Kind::AuthenticatorStateExpire(
4134 field,
4135 ),
4136 ) = &self.kind
4137 {
4138 Some(field as _)
4139 } else {
4140 None
4141 }
4142 }
4143 pub fn authenticator_state_expire_opt_mut(
4145 &mut self,
4146 ) -> Option<&mut super::AuthenticatorStateExpire> {
4147 if let Some(
4148 super::end_of_epoch_transaction_kind::Kind::AuthenticatorStateExpire(
4149 field,
4150 ),
4151 ) = &mut self.kind
4152 {
4153 Some(field as _)
4154 } else {
4155 None
4156 }
4157 }
4158 pub fn authenticator_state_expire_mut(
4162 &mut self,
4163 ) -> &mut super::AuthenticatorStateExpire {
4164 if self.authenticator_state_expire_opt_mut().is_none() {
4165 self.kind = Some(
4166 super::end_of_epoch_transaction_kind::Kind::AuthenticatorStateExpire(
4167 super::AuthenticatorStateExpire::default(),
4168 ),
4169 );
4170 }
4171 self.authenticator_state_expire_opt_mut().unwrap()
4172 }
4173 pub fn set_authenticator_state_expire<T: Into<super::AuthenticatorStateExpire>>(
4176 &mut self,
4177 field: T,
4178 ) {
4179 self.kind = Some(
4180 super::end_of_epoch_transaction_kind::Kind::AuthenticatorStateExpire(
4181 field.into().into(),
4182 ),
4183 );
4184 }
4185 pub fn with_authenticator_state_expire<T: Into<super::AuthenticatorStateExpire>>(
4188 mut self,
4189 field: T,
4190 ) -> Self {
4191 self.set_authenticator_state_expire(field.into());
4192 self
4193 }
4194 pub fn execution_time_observations(&self) -> &super::ExecutionTimeObservations {
4196 if let Some(
4197 super::end_of_epoch_transaction_kind::Kind::ExecutionTimeObservations(
4198 field,
4199 ),
4200 ) = &self.kind
4201 {
4202 field as _
4203 } else {
4204 super::ExecutionTimeObservations::default_instance() as _
4205 }
4206 }
4207 pub fn execution_time_observations_opt(
4209 &self,
4210 ) -> Option<&super::ExecutionTimeObservations> {
4211 if let Some(
4212 super::end_of_epoch_transaction_kind::Kind::ExecutionTimeObservations(
4213 field,
4214 ),
4215 ) = &self.kind
4216 {
4217 Some(field as _)
4218 } else {
4219 None
4220 }
4221 }
4222 pub fn execution_time_observations_opt_mut(
4224 &mut self,
4225 ) -> Option<&mut super::ExecutionTimeObservations> {
4226 if let Some(
4227 super::end_of_epoch_transaction_kind::Kind::ExecutionTimeObservations(
4228 field,
4229 ),
4230 ) = &mut self.kind
4231 {
4232 Some(field as _)
4233 } else {
4234 None
4235 }
4236 }
4237 pub fn execution_time_observations_mut(
4241 &mut self,
4242 ) -> &mut super::ExecutionTimeObservations {
4243 if self.execution_time_observations_opt_mut().is_none() {
4244 self.kind = Some(
4245 super::end_of_epoch_transaction_kind::Kind::ExecutionTimeObservations(
4246 super::ExecutionTimeObservations::default(),
4247 ),
4248 );
4249 }
4250 self.execution_time_observations_opt_mut().unwrap()
4251 }
4252 pub fn set_execution_time_observations<
4255 T: Into<super::ExecutionTimeObservations>,
4256 >(&mut self, field: T) {
4257 self.kind = Some(
4258 super::end_of_epoch_transaction_kind::Kind::ExecutionTimeObservations(
4259 field.into().into(),
4260 ),
4261 );
4262 }
4263 pub fn with_execution_time_observations<
4266 T: Into<super::ExecutionTimeObservations>,
4267 >(mut self, field: T) -> Self {
4268 self.set_execution_time_observations(field.into());
4269 self
4270 }
4271 pub fn bridge_state_create(&self) -> &str {
4273 if let Some(
4274 super::end_of_epoch_transaction_kind::Kind::BridgeStateCreate(field),
4275 ) = &self.kind
4276 {
4277 field as _
4278 } else {
4279 ""
4280 }
4281 }
4282 pub fn bridge_state_create_opt(&self) -> Option<&str> {
4284 if let Some(
4285 super::end_of_epoch_transaction_kind::Kind::BridgeStateCreate(field),
4286 ) = &self.kind
4287 {
4288 Some(field as _)
4289 } else {
4290 None
4291 }
4292 }
4293 pub fn bridge_state_create_opt_mut(&mut self) -> Option<&mut String> {
4295 if let Some(
4296 super::end_of_epoch_transaction_kind::Kind::BridgeStateCreate(field),
4297 ) = &mut self.kind
4298 {
4299 Some(field as _)
4300 } else {
4301 None
4302 }
4303 }
4304 pub fn bridge_state_create_mut(&mut self) -> &mut String {
4308 if self.bridge_state_create_opt_mut().is_none() {
4309 self.kind = Some(
4310 super::end_of_epoch_transaction_kind::Kind::BridgeStateCreate(
4311 String::default(),
4312 ),
4313 );
4314 }
4315 self.bridge_state_create_opt_mut().unwrap()
4316 }
4317 pub fn set_bridge_state_create<T: Into<String>>(&mut self, field: T) {
4320 self.kind = Some(
4321 super::end_of_epoch_transaction_kind::Kind::BridgeStateCreate(
4322 field.into().into(),
4323 ),
4324 );
4325 }
4326 pub fn with_bridge_state_create<T: Into<String>>(mut self, field: T) -> Self {
4329 self.set_bridge_state_create(field.into());
4330 self
4331 }
4332 pub fn bridge_committee_init(&self) -> u64 {
4334 if let Some(
4335 super::end_of_epoch_transaction_kind::Kind::BridgeCommitteeInit(field),
4336 ) = &self.kind
4337 {
4338 *field
4339 } else {
4340 0u64
4341 }
4342 }
4343 pub fn bridge_committee_init_opt(&self) -> Option<u64> {
4345 if let Some(
4346 super::end_of_epoch_transaction_kind::Kind::BridgeCommitteeInit(field),
4347 ) = &self.kind
4348 {
4349 Some(*field)
4350 } else {
4351 None
4352 }
4353 }
4354 pub fn bridge_committee_init_opt_mut(&mut self) -> Option<&mut u64> {
4356 if let Some(
4357 super::end_of_epoch_transaction_kind::Kind::BridgeCommitteeInit(field),
4358 ) = &mut self.kind
4359 {
4360 Some(field as _)
4361 } else {
4362 None
4363 }
4364 }
4365 pub fn bridge_committee_init_mut(&mut self) -> &mut u64 {
4369 if self.bridge_committee_init_opt_mut().is_none() {
4370 self.kind = Some(
4371 super::end_of_epoch_transaction_kind::Kind::BridgeCommitteeInit(
4372 u64::default(),
4373 ),
4374 );
4375 }
4376 self.bridge_committee_init_opt_mut().unwrap()
4377 }
4378 pub fn set_bridge_committee_init<T: Into<u64>>(&mut self, field: T) {
4381 self.kind = Some(
4382 super::end_of_epoch_transaction_kind::Kind::BridgeCommitteeInit(
4383 field.into().into(),
4384 ),
4385 );
4386 }
4387 pub fn with_bridge_committee_init<T: Into<u64>>(mut self, field: T) -> Self {
4390 self.set_bridge_committee_init(field.into());
4391 self
4392 }
4393 }
4394 impl super::Epoch {
4395 pub const fn const_default() -> Self {
4396 Self {
4397 epoch: None,
4398 committee: None,
4399 system_state: None,
4400 first_checkpoint: None,
4401 last_checkpoint: None,
4402 start: None,
4403 end: None,
4404 reference_gas_price: None,
4405 protocol_config: None,
4406 }
4407 }
4408 #[doc(hidden)]
4409 pub fn default_instance() -> &'static Self {
4410 static DEFAULT: super::Epoch = super::Epoch::const_default();
4411 &DEFAULT
4412 }
4413 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
4415 self.epoch.as_mut().map(|field| field as _)
4416 }
4417 pub fn epoch_mut(&mut self) -> &mut u64 {
4420 self.epoch.get_or_insert_default()
4421 }
4422 pub fn epoch_opt(&self) -> Option<u64> {
4424 self.epoch.as_ref().map(|field| *field)
4425 }
4426 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
4428 self.epoch = Some(field.into().into());
4429 }
4430 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
4432 self.set_epoch(field.into());
4433 self
4434 }
4435 pub fn committee(&self) -> &super::ValidatorCommittee {
4437 self.committee
4438 .as_ref()
4439 .map(|field| field as _)
4440 .unwrap_or_else(|| super::ValidatorCommittee::default_instance() as _)
4441 }
4442 pub fn committee_opt_mut(&mut self) -> Option<&mut super::ValidatorCommittee> {
4444 self.committee.as_mut().map(|field| field as _)
4445 }
4446 pub fn committee_mut(&mut self) -> &mut super::ValidatorCommittee {
4449 self.committee.get_or_insert_default()
4450 }
4451 pub fn committee_opt(&self) -> Option<&super::ValidatorCommittee> {
4453 self.committee.as_ref().map(|field| field as _)
4454 }
4455 pub fn set_committee<T: Into<super::ValidatorCommittee>>(&mut self, field: T) {
4457 self.committee = Some(field.into().into());
4458 }
4459 pub fn with_committee<T: Into<super::ValidatorCommittee>>(
4461 mut self,
4462 field: T,
4463 ) -> Self {
4464 self.set_committee(field.into());
4465 self
4466 }
4467 pub fn system_state(&self) -> &super::SystemState {
4469 self.system_state
4470 .as_ref()
4471 .map(|field| field as _)
4472 .unwrap_or_else(|| super::SystemState::default_instance() as _)
4473 }
4474 pub fn system_state_opt_mut(&mut self) -> Option<&mut super::SystemState> {
4476 self.system_state.as_mut().map(|field| field as _)
4477 }
4478 pub fn system_state_mut(&mut self) -> &mut super::SystemState {
4481 self.system_state.get_or_insert_default()
4482 }
4483 pub fn system_state_opt(&self) -> Option<&super::SystemState> {
4485 self.system_state.as_ref().map(|field| field as _)
4486 }
4487 pub fn set_system_state<T: Into<super::SystemState>>(&mut self, field: T) {
4489 self.system_state = Some(field.into().into());
4490 }
4491 pub fn with_system_state<T: Into<super::SystemState>>(
4493 mut self,
4494 field: T,
4495 ) -> Self {
4496 self.set_system_state(field.into());
4497 self
4498 }
4499 pub fn first_checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
4501 self.first_checkpoint.as_mut().map(|field| field as _)
4502 }
4503 pub fn first_checkpoint_mut(&mut self) -> &mut u64 {
4506 self.first_checkpoint.get_or_insert_default()
4507 }
4508 pub fn first_checkpoint_opt(&self) -> Option<u64> {
4510 self.first_checkpoint.as_ref().map(|field| *field)
4511 }
4512 pub fn set_first_checkpoint<T: Into<u64>>(&mut self, field: T) {
4514 self.first_checkpoint = Some(field.into().into());
4515 }
4516 pub fn with_first_checkpoint<T: Into<u64>>(mut self, field: T) -> Self {
4518 self.set_first_checkpoint(field.into());
4519 self
4520 }
4521 pub fn last_checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
4523 self.last_checkpoint.as_mut().map(|field| field as _)
4524 }
4525 pub fn last_checkpoint_mut(&mut self) -> &mut u64 {
4528 self.last_checkpoint.get_or_insert_default()
4529 }
4530 pub fn last_checkpoint_opt(&self) -> Option<u64> {
4532 self.last_checkpoint.as_ref().map(|field| *field)
4533 }
4534 pub fn set_last_checkpoint<T: Into<u64>>(&mut self, field: T) {
4536 self.last_checkpoint = Some(field.into().into());
4537 }
4538 pub fn with_last_checkpoint<T: Into<u64>>(mut self, field: T) -> Self {
4540 self.set_last_checkpoint(field.into());
4541 self
4542 }
4543 pub fn start_opt_mut(&mut self) -> Option<&mut ::prost_types::Timestamp> {
4545 self.start.as_mut().map(|field| field as _)
4546 }
4547 pub fn start_mut(&mut self) -> &mut ::prost_types::Timestamp {
4550 self.start.get_or_insert_default()
4551 }
4552 pub fn start_opt(&self) -> Option<&::prost_types::Timestamp> {
4554 self.start.as_ref().map(|field| field as _)
4555 }
4556 pub fn set_start<T: Into<::prost_types::Timestamp>>(&mut self, field: T) {
4558 self.start = Some(field.into().into());
4559 }
4560 pub fn with_start<T: Into<::prost_types::Timestamp>>(
4562 mut self,
4563 field: T,
4564 ) -> Self {
4565 self.set_start(field.into());
4566 self
4567 }
4568 pub fn end_opt_mut(&mut self) -> Option<&mut ::prost_types::Timestamp> {
4570 self.end.as_mut().map(|field| field as _)
4571 }
4572 pub fn end_mut(&mut self) -> &mut ::prost_types::Timestamp {
4575 self.end.get_or_insert_default()
4576 }
4577 pub fn end_opt(&self) -> Option<&::prost_types::Timestamp> {
4579 self.end.as_ref().map(|field| field as _)
4580 }
4581 pub fn set_end<T: Into<::prost_types::Timestamp>>(&mut self, field: T) {
4583 self.end = Some(field.into().into());
4584 }
4585 pub fn with_end<T: Into<::prost_types::Timestamp>>(mut self, field: T) -> Self {
4587 self.set_end(field.into());
4588 self
4589 }
4590 pub fn reference_gas_price_opt_mut(&mut self) -> Option<&mut u64> {
4592 self.reference_gas_price.as_mut().map(|field| field as _)
4593 }
4594 pub fn reference_gas_price_mut(&mut self) -> &mut u64 {
4597 self.reference_gas_price.get_or_insert_default()
4598 }
4599 pub fn reference_gas_price_opt(&self) -> Option<u64> {
4601 self.reference_gas_price.as_ref().map(|field| *field)
4602 }
4603 pub fn set_reference_gas_price<T: Into<u64>>(&mut self, field: T) {
4605 self.reference_gas_price = Some(field.into().into());
4606 }
4607 pub fn with_reference_gas_price<T: Into<u64>>(mut self, field: T) -> Self {
4609 self.set_reference_gas_price(field.into());
4610 self
4611 }
4612 pub fn protocol_config(&self) -> &super::ProtocolConfig {
4614 self.protocol_config
4615 .as_ref()
4616 .map(|field| field as _)
4617 .unwrap_or_else(|| super::ProtocolConfig::default_instance() as _)
4618 }
4619 pub fn protocol_config_opt_mut(&mut self) -> Option<&mut super::ProtocolConfig> {
4621 self.protocol_config.as_mut().map(|field| field as _)
4622 }
4623 pub fn protocol_config_mut(&mut self) -> &mut super::ProtocolConfig {
4626 self.protocol_config.get_or_insert_default()
4627 }
4628 pub fn protocol_config_opt(&self) -> Option<&super::ProtocolConfig> {
4630 self.protocol_config.as_ref().map(|field| field as _)
4631 }
4632 pub fn set_protocol_config<T: Into<super::ProtocolConfig>>(&mut self, field: T) {
4634 self.protocol_config = Some(field.into().into());
4635 }
4636 pub fn with_protocol_config<T: Into<super::ProtocolConfig>>(
4638 mut self,
4639 field: T,
4640 ) -> Self {
4641 self.set_protocol_config(field.into());
4642 self
4643 }
4644 }
4645 impl super::Event {
4646 pub const fn const_default() -> Self {
4647 Self {
4648 package_id: None,
4649 module: None,
4650 sender: None,
4651 event_type: None,
4652 contents: None,
4653 json: None,
4654 }
4655 }
4656 #[doc(hidden)]
4657 pub fn default_instance() -> &'static Self {
4658 static DEFAULT: super::Event = super::Event::const_default();
4659 &DEFAULT
4660 }
4661 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
4663 self.package_id.as_mut().map(|field| field as _)
4664 }
4665 pub fn package_id_mut(&mut self) -> &mut String {
4668 self.package_id.get_or_insert_default()
4669 }
4670 pub fn package_id_opt(&self) -> Option<&str> {
4672 self.package_id.as_ref().map(|field| field as _)
4673 }
4674 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
4676 self.package_id = Some(field.into().into());
4677 }
4678 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
4680 self.set_package_id(field.into());
4681 self
4682 }
4683 pub fn module_opt_mut(&mut self) -> Option<&mut String> {
4685 self.module.as_mut().map(|field| field as _)
4686 }
4687 pub fn module_mut(&mut self) -> &mut String {
4690 self.module.get_or_insert_default()
4691 }
4692 pub fn module_opt(&self) -> Option<&str> {
4694 self.module.as_ref().map(|field| field as _)
4695 }
4696 pub fn set_module<T: Into<String>>(&mut self, field: T) {
4698 self.module = Some(field.into().into());
4699 }
4700 pub fn with_module<T: Into<String>>(mut self, field: T) -> Self {
4702 self.set_module(field.into());
4703 self
4704 }
4705 pub fn sender_opt_mut(&mut self) -> Option<&mut String> {
4707 self.sender.as_mut().map(|field| field as _)
4708 }
4709 pub fn sender_mut(&mut self) -> &mut String {
4712 self.sender.get_or_insert_default()
4713 }
4714 pub fn sender_opt(&self) -> Option<&str> {
4716 self.sender.as_ref().map(|field| field as _)
4717 }
4718 pub fn set_sender<T: Into<String>>(&mut self, field: T) {
4720 self.sender = Some(field.into().into());
4721 }
4722 pub fn with_sender<T: Into<String>>(mut self, field: T) -> Self {
4724 self.set_sender(field.into());
4725 self
4726 }
4727 pub fn event_type_opt_mut(&mut self) -> Option<&mut String> {
4729 self.event_type.as_mut().map(|field| field as _)
4730 }
4731 pub fn event_type_mut(&mut self) -> &mut String {
4734 self.event_type.get_or_insert_default()
4735 }
4736 pub fn event_type_opt(&self) -> Option<&str> {
4738 self.event_type.as_ref().map(|field| field as _)
4739 }
4740 pub fn set_event_type<T: Into<String>>(&mut self, field: T) {
4742 self.event_type = Some(field.into().into());
4743 }
4744 pub fn with_event_type<T: Into<String>>(mut self, field: T) -> Self {
4746 self.set_event_type(field.into());
4747 self
4748 }
4749 pub fn contents(&self) -> &super::Bcs {
4751 self.contents
4752 .as_ref()
4753 .map(|field| field as _)
4754 .unwrap_or_else(|| super::Bcs::default_instance() as _)
4755 }
4756 pub fn contents_opt_mut(&mut self) -> Option<&mut super::Bcs> {
4758 self.contents.as_mut().map(|field| field as _)
4759 }
4760 pub fn contents_mut(&mut self) -> &mut super::Bcs {
4763 self.contents.get_or_insert_default()
4764 }
4765 pub fn contents_opt(&self) -> Option<&super::Bcs> {
4767 self.contents.as_ref().map(|field| field as _)
4768 }
4769 pub fn set_contents<T: Into<super::Bcs>>(&mut self, field: T) {
4771 self.contents = Some(field.into().into());
4772 }
4773 pub fn with_contents<T: Into<super::Bcs>>(mut self, field: T) -> Self {
4775 self.set_contents(field.into());
4776 self
4777 }
4778 pub fn json_opt_mut(&mut self) -> Option<&mut ::prost_types::Value> {
4780 self.json.as_mut().map(|field| field as _)
4781 }
4782 pub fn json_mut(&mut self) -> &mut ::prost_types::Value {
4785 self.json.get_or_insert_default()
4786 }
4787 pub fn json_opt(&self) -> Option<&::prost_types::Value> {
4789 self.json.as_ref().map(|field| field as _)
4790 }
4791 pub fn set_json<T: Into<::prost_types::Value>>(&mut self, field: T) {
4793 self.json = Some(field.into().into());
4794 }
4795 pub fn with_json<T: Into<::prost_types::Value>>(mut self, field: T) -> Self {
4797 self.set_json(field.into());
4798 self
4799 }
4800 }
4801 impl super::ExecuteTransactionRequest {
4802 pub const fn const_default() -> Self {
4803 Self {
4804 transaction: None,
4805 signatures: Vec::new(),
4806 read_mask: None,
4807 }
4808 }
4809 #[doc(hidden)]
4810 pub fn default_instance() -> &'static Self {
4811 static DEFAULT: super::ExecuteTransactionRequest = super::ExecuteTransactionRequest::const_default();
4812 &DEFAULT
4813 }
4814 pub fn transaction(&self) -> &super::Transaction {
4816 self.transaction
4817 .as_ref()
4818 .map(|field| field as _)
4819 .unwrap_or_else(|| super::Transaction::default_instance() as _)
4820 }
4821 pub fn transaction_opt_mut(&mut self) -> Option<&mut super::Transaction> {
4823 self.transaction.as_mut().map(|field| field as _)
4824 }
4825 pub fn transaction_mut(&mut self) -> &mut super::Transaction {
4828 self.transaction.get_or_insert_default()
4829 }
4830 pub fn transaction_opt(&self) -> Option<&super::Transaction> {
4832 self.transaction.as_ref().map(|field| field as _)
4833 }
4834 pub fn set_transaction<T: Into<super::Transaction>>(&mut self, field: T) {
4836 self.transaction = Some(field.into().into());
4837 }
4838 pub fn with_transaction<T: Into<super::Transaction>>(
4840 mut self,
4841 field: T,
4842 ) -> Self {
4843 self.set_transaction(field.into());
4844 self
4845 }
4846 pub fn signatures(&self) -> &[super::UserSignature] {
4848 &self.signatures
4849 }
4850 pub fn signatures_mut(&mut self) -> &mut Vec<super::UserSignature> {
4853 &mut self.signatures
4854 }
4855 pub fn set_signatures(&mut self, field: Vec<super::UserSignature>) {
4857 self.signatures = field;
4858 }
4859 pub fn with_signatures(mut self, field: Vec<super::UserSignature>) -> Self {
4861 self.set_signatures(field);
4862 self
4863 }
4864 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
4866 self.read_mask.as_mut().map(|field| field as _)
4867 }
4868 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
4871 self.read_mask.get_or_insert_default()
4872 }
4873 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
4875 self.read_mask.as_ref().map(|field| field as _)
4876 }
4877 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
4879 self.read_mask = Some(field.into().into());
4880 }
4881 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
4883 mut self,
4884 field: T,
4885 ) -> Self {
4886 self.set_read_mask(field.into());
4887 self
4888 }
4889 }
4890 impl super::ExecuteTransactionResponse {
4891 pub const fn const_default() -> Self {
4892 Self {
4893 finality: None,
4894 transaction: None,
4895 }
4896 }
4897 #[doc(hidden)]
4898 pub fn default_instance() -> &'static Self {
4899 static DEFAULT: super::ExecuteTransactionResponse = super::ExecuteTransactionResponse::const_default();
4900 &DEFAULT
4901 }
4902 pub fn finality(&self) -> &super::TransactionFinality {
4904 self.finality
4905 .as_ref()
4906 .map(|field| field as _)
4907 .unwrap_or_else(|| super::TransactionFinality::default_instance() as _)
4908 }
4909 pub fn finality_opt_mut(&mut self) -> Option<&mut super::TransactionFinality> {
4911 self.finality.as_mut().map(|field| field as _)
4912 }
4913 pub fn finality_mut(&mut self) -> &mut super::TransactionFinality {
4916 self.finality.get_or_insert_default()
4917 }
4918 pub fn finality_opt(&self) -> Option<&super::TransactionFinality> {
4920 self.finality.as_ref().map(|field| field as _)
4921 }
4922 pub fn set_finality<T: Into<super::TransactionFinality>>(&mut self, field: T) {
4924 self.finality = Some(field.into().into());
4925 }
4926 pub fn with_finality<T: Into<super::TransactionFinality>>(
4928 mut self,
4929 field: T,
4930 ) -> Self {
4931 self.set_finality(field.into());
4932 self
4933 }
4934 pub fn transaction(&self) -> &super::ExecutedTransaction {
4936 self.transaction
4937 .as_ref()
4938 .map(|field| field as _)
4939 .unwrap_or_else(|| super::ExecutedTransaction::default_instance() as _)
4940 }
4941 pub fn transaction_opt_mut(
4943 &mut self,
4944 ) -> Option<&mut super::ExecutedTransaction> {
4945 self.transaction.as_mut().map(|field| field as _)
4946 }
4947 pub fn transaction_mut(&mut self) -> &mut super::ExecutedTransaction {
4950 self.transaction.get_or_insert_default()
4951 }
4952 pub fn transaction_opt(&self) -> Option<&super::ExecutedTransaction> {
4954 self.transaction.as_ref().map(|field| field as _)
4955 }
4956 pub fn set_transaction<T: Into<super::ExecutedTransaction>>(
4958 &mut self,
4959 field: T,
4960 ) {
4961 self.transaction = Some(field.into().into());
4962 }
4963 pub fn with_transaction<T: Into<super::ExecutedTransaction>>(
4965 mut self,
4966 field: T,
4967 ) -> Self {
4968 self.set_transaction(field.into());
4969 self
4970 }
4971 }
4972 impl super::ExecutedTransaction {
4973 pub const fn const_default() -> Self {
4974 Self {
4975 digest: None,
4976 transaction: None,
4977 signatures: Vec::new(),
4978 effects: None,
4979 events: None,
4980 checkpoint: None,
4981 timestamp: None,
4982 balance_changes: Vec::new(),
4983 input_objects: Vec::new(),
4984 output_objects: Vec::new(),
4985 }
4986 }
4987 #[doc(hidden)]
4988 pub fn default_instance() -> &'static Self {
4989 static DEFAULT: super::ExecutedTransaction = super::ExecutedTransaction::const_default();
4990 &DEFAULT
4991 }
4992 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
4994 self.digest.as_mut().map(|field| field as _)
4995 }
4996 pub fn digest_mut(&mut self) -> &mut String {
4999 self.digest.get_or_insert_default()
5000 }
5001 pub fn digest_opt(&self) -> Option<&str> {
5003 self.digest.as_ref().map(|field| field as _)
5004 }
5005 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
5007 self.digest = Some(field.into().into());
5008 }
5009 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
5011 self.set_digest(field.into());
5012 self
5013 }
5014 pub fn transaction(&self) -> &super::Transaction {
5016 self.transaction
5017 .as_ref()
5018 .map(|field| field as _)
5019 .unwrap_or_else(|| super::Transaction::default_instance() as _)
5020 }
5021 pub fn transaction_opt_mut(&mut self) -> Option<&mut super::Transaction> {
5023 self.transaction.as_mut().map(|field| field as _)
5024 }
5025 pub fn transaction_mut(&mut self) -> &mut super::Transaction {
5028 self.transaction.get_or_insert_default()
5029 }
5030 pub fn transaction_opt(&self) -> Option<&super::Transaction> {
5032 self.transaction.as_ref().map(|field| field as _)
5033 }
5034 pub fn set_transaction<T: Into<super::Transaction>>(&mut self, field: T) {
5036 self.transaction = Some(field.into().into());
5037 }
5038 pub fn with_transaction<T: Into<super::Transaction>>(
5040 mut self,
5041 field: T,
5042 ) -> Self {
5043 self.set_transaction(field.into());
5044 self
5045 }
5046 pub fn signatures(&self) -> &[super::UserSignature] {
5048 &self.signatures
5049 }
5050 pub fn signatures_mut(&mut self) -> &mut Vec<super::UserSignature> {
5053 &mut self.signatures
5054 }
5055 pub fn set_signatures(&mut self, field: Vec<super::UserSignature>) {
5057 self.signatures = field;
5058 }
5059 pub fn with_signatures(mut self, field: Vec<super::UserSignature>) -> Self {
5061 self.set_signatures(field);
5062 self
5063 }
5064 pub fn effects(&self) -> &super::TransactionEffects {
5066 self.effects
5067 .as_ref()
5068 .map(|field| field as _)
5069 .unwrap_or_else(|| super::TransactionEffects::default_instance() as _)
5070 }
5071 pub fn effects_opt_mut(&mut self) -> Option<&mut super::TransactionEffects> {
5073 self.effects.as_mut().map(|field| field as _)
5074 }
5075 pub fn effects_mut(&mut self) -> &mut super::TransactionEffects {
5078 self.effects.get_or_insert_default()
5079 }
5080 pub fn effects_opt(&self) -> Option<&super::TransactionEffects> {
5082 self.effects.as_ref().map(|field| field as _)
5083 }
5084 pub fn set_effects<T: Into<super::TransactionEffects>>(&mut self, field: T) {
5086 self.effects = Some(field.into().into());
5087 }
5088 pub fn with_effects<T: Into<super::TransactionEffects>>(
5090 mut self,
5091 field: T,
5092 ) -> Self {
5093 self.set_effects(field.into());
5094 self
5095 }
5096 pub fn events(&self) -> &super::TransactionEvents {
5098 self.events
5099 .as_ref()
5100 .map(|field| field as _)
5101 .unwrap_or_else(|| super::TransactionEvents::default_instance() as _)
5102 }
5103 pub fn events_opt_mut(&mut self) -> Option<&mut super::TransactionEvents> {
5105 self.events.as_mut().map(|field| field as _)
5106 }
5107 pub fn events_mut(&mut self) -> &mut super::TransactionEvents {
5110 self.events.get_or_insert_default()
5111 }
5112 pub fn events_opt(&self) -> Option<&super::TransactionEvents> {
5114 self.events.as_ref().map(|field| field as _)
5115 }
5116 pub fn set_events<T: Into<super::TransactionEvents>>(&mut self, field: T) {
5118 self.events = Some(field.into().into());
5119 }
5120 pub fn with_events<T: Into<super::TransactionEvents>>(
5122 mut self,
5123 field: T,
5124 ) -> Self {
5125 self.set_events(field.into());
5126 self
5127 }
5128 pub fn checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
5130 self.checkpoint.as_mut().map(|field| field as _)
5131 }
5132 pub fn checkpoint_mut(&mut self) -> &mut u64 {
5135 self.checkpoint.get_or_insert_default()
5136 }
5137 pub fn checkpoint_opt(&self) -> Option<u64> {
5139 self.checkpoint.as_ref().map(|field| *field)
5140 }
5141 pub fn set_checkpoint<T: Into<u64>>(&mut self, field: T) {
5143 self.checkpoint = Some(field.into().into());
5144 }
5145 pub fn with_checkpoint<T: Into<u64>>(mut self, field: T) -> Self {
5147 self.set_checkpoint(field.into());
5148 self
5149 }
5150 pub fn timestamp_opt_mut(&mut self) -> Option<&mut ::prost_types::Timestamp> {
5152 self.timestamp.as_mut().map(|field| field as _)
5153 }
5154 pub fn timestamp_mut(&mut self) -> &mut ::prost_types::Timestamp {
5157 self.timestamp.get_or_insert_default()
5158 }
5159 pub fn timestamp_opt(&self) -> Option<&::prost_types::Timestamp> {
5161 self.timestamp.as_ref().map(|field| field as _)
5162 }
5163 pub fn set_timestamp<T: Into<::prost_types::Timestamp>>(&mut self, field: T) {
5165 self.timestamp = Some(field.into().into());
5166 }
5167 pub fn with_timestamp<T: Into<::prost_types::Timestamp>>(
5169 mut self,
5170 field: T,
5171 ) -> Self {
5172 self.set_timestamp(field.into());
5173 self
5174 }
5175 pub fn balance_changes(&self) -> &[super::BalanceChange] {
5177 &self.balance_changes
5178 }
5179 pub fn balance_changes_mut(&mut self) -> &mut Vec<super::BalanceChange> {
5182 &mut self.balance_changes
5183 }
5184 pub fn set_balance_changes(&mut self, field: Vec<super::BalanceChange>) {
5186 self.balance_changes = field;
5187 }
5188 pub fn with_balance_changes(mut self, field: Vec<super::BalanceChange>) -> Self {
5190 self.set_balance_changes(field);
5191 self
5192 }
5193 pub fn input_objects(&self) -> &[super::Object] {
5195 &self.input_objects
5196 }
5197 pub fn input_objects_mut(&mut self) -> &mut Vec<super::Object> {
5200 &mut self.input_objects
5201 }
5202 pub fn set_input_objects(&mut self, field: Vec<super::Object>) {
5204 self.input_objects = field;
5205 }
5206 pub fn with_input_objects(mut self, field: Vec<super::Object>) -> Self {
5208 self.set_input_objects(field);
5209 self
5210 }
5211 pub fn output_objects(&self) -> &[super::Object] {
5213 &self.output_objects
5214 }
5215 pub fn output_objects_mut(&mut self) -> &mut Vec<super::Object> {
5218 &mut self.output_objects
5219 }
5220 pub fn set_output_objects(&mut self, field: Vec<super::Object>) {
5222 self.output_objects = field;
5223 }
5224 pub fn with_output_objects(mut self, field: Vec<super::Object>) -> Self {
5226 self.set_output_objects(field);
5227 self
5228 }
5229 }
5230 impl super::ExecutionError {
5231 pub const fn const_default() -> Self {
5232 Self {
5233 description: None,
5234 command: None,
5235 kind: None,
5236 error_details: None,
5237 }
5238 }
5239 #[doc(hidden)]
5240 pub fn default_instance() -> &'static Self {
5241 static DEFAULT: super::ExecutionError = super::ExecutionError::const_default();
5242 &DEFAULT
5243 }
5244 pub fn description_opt_mut(&mut self) -> Option<&mut String> {
5246 self.description.as_mut().map(|field| field as _)
5247 }
5248 pub fn description_mut(&mut self) -> &mut String {
5251 self.description.get_or_insert_default()
5252 }
5253 pub fn description_opt(&self) -> Option<&str> {
5255 self.description.as_ref().map(|field| field as _)
5256 }
5257 pub fn set_description<T: Into<String>>(&mut self, field: T) {
5259 self.description = Some(field.into().into());
5260 }
5261 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
5263 self.set_description(field.into());
5264 self
5265 }
5266 pub fn command_opt_mut(&mut self) -> Option<&mut u64> {
5268 self.command.as_mut().map(|field| field as _)
5269 }
5270 pub fn command_mut(&mut self) -> &mut u64 {
5273 self.command.get_or_insert_default()
5274 }
5275 pub fn command_opt(&self) -> Option<u64> {
5277 self.command.as_ref().map(|field| *field)
5278 }
5279 pub fn set_command<T: Into<u64>>(&mut self, field: T) {
5281 self.command = Some(field.into().into());
5282 }
5283 pub fn with_command<T: Into<u64>>(mut self, field: T) -> Self {
5285 self.set_command(field.into());
5286 self
5287 }
5288 pub fn with_kind<T: Into<super::execution_error::ExecutionErrorKind>>(
5290 mut self,
5291 field: T,
5292 ) -> Self {
5293 self.set_kind(field.into());
5294 self
5295 }
5296 pub fn abort(&self) -> &super::MoveAbort {
5298 if let Some(super::execution_error::ErrorDetails::Abort(field)) = &self
5299 .error_details
5300 {
5301 field as _
5302 } else {
5303 super::MoveAbort::default_instance() as _
5304 }
5305 }
5306 pub fn abort_opt(&self) -> Option<&super::MoveAbort> {
5308 if let Some(super::execution_error::ErrorDetails::Abort(field)) = &self
5309 .error_details
5310 {
5311 Some(field as _)
5312 } else {
5313 None
5314 }
5315 }
5316 pub fn abort_opt_mut(&mut self) -> Option<&mut super::MoveAbort> {
5318 if let Some(super::execution_error::ErrorDetails::Abort(field)) = &mut self
5319 .error_details
5320 {
5321 Some(field as _)
5322 } else {
5323 None
5324 }
5325 }
5326 pub fn abort_mut(&mut self) -> &mut super::MoveAbort {
5330 if self.abort_opt_mut().is_none() {
5331 self.error_details = Some(
5332 super::execution_error::ErrorDetails::Abort(
5333 super::MoveAbort::default(),
5334 ),
5335 );
5336 }
5337 self.abort_opt_mut().unwrap()
5338 }
5339 pub fn set_abort<T: Into<super::MoveAbort>>(&mut self, field: T) {
5342 self.error_details = Some(
5343 super::execution_error::ErrorDetails::Abort(field.into().into()),
5344 );
5345 }
5346 pub fn with_abort<T: Into<super::MoveAbort>>(mut self, field: T) -> Self {
5349 self.set_abort(field.into());
5350 self
5351 }
5352 pub fn size_error(&self) -> &super::SizeError {
5354 if let Some(super::execution_error::ErrorDetails::SizeError(field)) = &self
5355 .error_details
5356 {
5357 field as _
5358 } else {
5359 super::SizeError::default_instance() as _
5360 }
5361 }
5362 pub fn size_error_opt(&self) -> Option<&super::SizeError> {
5364 if let Some(super::execution_error::ErrorDetails::SizeError(field)) = &self
5365 .error_details
5366 {
5367 Some(field as _)
5368 } else {
5369 None
5370 }
5371 }
5372 pub fn size_error_opt_mut(&mut self) -> Option<&mut super::SizeError> {
5374 if let Some(super::execution_error::ErrorDetails::SizeError(field)) = &mut self
5375 .error_details
5376 {
5377 Some(field as _)
5378 } else {
5379 None
5380 }
5381 }
5382 pub fn size_error_mut(&mut self) -> &mut super::SizeError {
5386 if self.size_error_opt_mut().is_none() {
5387 self.error_details = Some(
5388 super::execution_error::ErrorDetails::SizeError(
5389 super::SizeError::default(),
5390 ),
5391 );
5392 }
5393 self.size_error_opt_mut().unwrap()
5394 }
5395 pub fn set_size_error<T: Into<super::SizeError>>(&mut self, field: T) {
5398 self.error_details = Some(
5399 super::execution_error::ErrorDetails::SizeError(field.into().into()),
5400 );
5401 }
5402 pub fn with_size_error<T: Into<super::SizeError>>(mut self, field: T) -> Self {
5405 self.set_size_error(field.into());
5406 self
5407 }
5408 pub fn command_argument_error(&self) -> &super::CommandArgumentError {
5410 if let Some(
5411 super::execution_error::ErrorDetails::CommandArgumentError(field),
5412 ) = &self.error_details
5413 {
5414 field as _
5415 } else {
5416 super::CommandArgumentError::default_instance() as _
5417 }
5418 }
5419 pub fn command_argument_error_opt(
5421 &self,
5422 ) -> Option<&super::CommandArgumentError> {
5423 if let Some(
5424 super::execution_error::ErrorDetails::CommandArgumentError(field),
5425 ) = &self.error_details
5426 {
5427 Some(field as _)
5428 } else {
5429 None
5430 }
5431 }
5432 pub fn command_argument_error_opt_mut(
5434 &mut self,
5435 ) -> Option<&mut super::CommandArgumentError> {
5436 if let Some(
5437 super::execution_error::ErrorDetails::CommandArgumentError(field),
5438 ) = &mut self.error_details
5439 {
5440 Some(field as _)
5441 } else {
5442 None
5443 }
5444 }
5445 pub fn command_argument_error_mut(
5449 &mut self,
5450 ) -> &mut super::CommandArgumentError {
5451 if self.command_argument_error_opt_mut().is_none() {
5452 self.error_details = Some(
5453 super::execution_error::ErrorDetails::CommandArgumentError(
5454 super::CommandArgumentError::default(),
5455 ),
5456 );
5457 }
5458 self.command_argument_error_opt_mut().unwrap()
5459 }
5460 pub fn set_command_argument_error<T: Into<super::CommandArgumentError>>(
5463 &mut self,
5464 field: T,
5465 ) {
5466 self.error_details = Some(
5467 super::execution_error::ErrorDetails::CommandArgumentError(
5468 field.into().into(),
5469 ),
5470 );
5471 }
5472 pub fn with_command_argument_error<T: Into<super::CommandArgumentError>>(
5475 mut self,
5476 field: T,
5477 ) -> Self {
5478 self.set_command_argument_error(field.into());
5479 self
5480 }
5481 pub fn type_argument_error(&self) -> &super::TypeArgumentError {
5483 if let Some(
5484 super::execution_error::ErrorDetails::TypeArgumentError(field),
5485 ) = &self.error_details
5486 {
5487 field as _
5488 } else {
5489 super::TypeArgumentError::default_instance() as _
5490 }
5491 }
5492 pub fn type_argument_error_opt(&self) -> Option<&super::TypeArgumentError> {
5494 if let Some(
5495 super::execution_error::ErrorDetails::TypeArgumentError(field),
5496 ) = &self.error_details
5497 {
5498 Some(field as _)
5499 } else {
5500 None
5501 }
5502 }
5503 pub fn type_argument_error_opt_mut(
5505 &mut self,
5506 ) -> Option<&mut super::TypeArgumentError> {
5507 if let Some(
5508 super::execution_error::ErrorDetails::TypeArgumentError(field),
5509 ) = &mut self.error_details
5510 {
5511 Some(field as _)
5512 } else {
5513 None
5514 }
5515 }
5516 pub fn type_argument_error_mut(&mut self) -> &mut super::TypeArgumentError {
5520 if self.type_argument_error_opt_mut().is_none() {
5521 self.error_details = Some(
5522 super::execution_error::ErrorDetails::TypeArgumentError(
5523 super::TypeArgumentError::default(),
5524 ),
5525 );
5526 }
5527 self.type_argument_error_opt_mut().unwrap()
5528 }
5529 pub fn set_type_argument_error<T: Into<super::TypeArgumentError>>(
5532 &mut self,
5533 field: T,
5534 ) {
5535 self.error_details = Some(
5536 super::execution_error::ErrorDetails::TypeArgumentError(
5537 field.into().into(),
5538 ),
5539 );
5540 }
5541 pub fn with_type_argument_error<T: Into<super::TypeArgumentError>>(
5544 mut self,
5545 field: T,
5546 ) -> Self {
5547 self.set_type_argument_error(field.into());
5548 self
5549 }
5550 pub fn package_upgrade_error(&self) -> &super::PackageUpgradeError {
5552 if let Some(
5553 super::execution_error::ErrorDetails::PackageUpgradeError(field),
5554 ) = &self.error_details
5555 {
5556 field as _
5557 } else {
5558 super::PackageUpgradeError::default_instance() as _
5559 }
5560 }
5561 pub fn package_upgrade_error_opt(&self) -> Option<&super::PackageUpgradeError> {
5563 if let Some(
5564 super::execution_error::ErrorDetails::PackageUpgradeError(field),
5565 ) = &self.error_details
5566 {
5567 Some(field as _)
5568 } else {
5569 None
5570 }
5571 }
5572 pub fn package_upgrade_error_opt_mut(
5574 &mut self,
5575 ) -> Option<&mut super::PackageUpgradeError> {
5576 if let Some(
5577 super::execution_error::ErrorDetails::PackageUpgradeError(field),
5578 ) = &mut self.error_details
5579 {
5580 Some(field as _)
5581 } else {
5582 None
5583 }
5584 }
5585 pub fn package_upgrade_error_mut(&mut self) -> &mut super::PackageUpgradeError {
5589 if self.package_upgrade_error_opt_mut().is_none() {
5590 self.error_details = Some(
5591 super::execution_error::ErrorDetails::PackageUpgradeError(
5592 super::PackageUpgradeError::default(),
5593 ),
5594 );
5595 }
5596 self.package_upgrade_error_opt_mut().unwrap()
5597 }
5598 pub fn set_package_upgrade_error<T: Into<super::PackageUpgradeError>>(
5601 &mut self,
5602 field: T,
5603 ) {
5604 self.error_details = Some(
5605 super::execution_error::ErrorDetails::PackageUpgradeError(
5606 field.into().into(),
5607 ),
5608 );
5609 }
5610 pub fn with_package_upgrade_error<T: Into<super::PackageUpgradeError>>(
5613 mut self,
5614 field: T,
5615 ) -> Self {
5616 self.set_package_upgrade_error(field.into());
5617 self
5618 }
5619 pub fn index_error(&self) -> &super::IndexError {
5621 if let Some(super::execution_error::ErrorDetails::IndexError(field)) = &self
5622 .error_details
5623 {
5624 field as _
5625 } else {
5626 super::IndexError::default_instance() as _
5627 }
5628 }
5629 pub fn index_error_opt(&self) -> Option<&super::IndexError> {
5631 if let Some(super::execution_error::ErrorDetails::IndexError(field)) = &self
5632 .error_details
5633 {
5634 Some(field as _)
5635 } else {
5636 None
5637 }
5638 }
5639 pub fn index_error_opt_mut(&mut self) -> Option<&mut super::IndexError> {
5641 if let Some(super::execution_error::ErrorDetails::IndexError(field)) = &mut self
5642 .error_details
5643 {
5644 Some(field as _)
5645 } else {
5646 None
5647 }
5648 }
5649 pub fn index_error_mut(&mut self) -> &mut super::IndexError {
5653 if self.index_error_opt_mut().is_none() {
5654 self.error_details = Some(
5655 super::execution_error::ErrorDetails::IndexError(
5656 super::IndexError::default(),
5657 ),
5658 );
5659 }
5660 self.index_error_opt_mut().unwrap()
5661 }
5662 pub fn set_index_error<T: Into<super::IndexError>>(&mut self, field: T) {
5665 self.error_details = Some(
5666 super::execution_error::ErrorDetails::IndexError(field.into().into()),
5667 );
5668 }
5669 pub fn with_index_error<T: Into<super::IndexError>>(mut self, field: T) -> Self {
5672 self.set_index_error(field.into());
5673 self
5674 }
5675 pub fn object_id(&self) -> &str {
5677 if let Some(super::execution_error::ErrorDetails::ObjectId(field)) = &self
5678 .error_details
5679 {
5680 field as _
5681 } else {
5682 ""
5683 }
5684 }
5685 pub fn object_id_opt(&self) -> Option<&str> {
5687 if let Some(super::execution_error::ErrorDetails::ObjectId(field)) = &self
5688 .error_details
5689 {
5690 Some(field as _)
5691 } else {
5692 None
5693 }
5694 }
5695 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
5697 if let Some(super::execution_error::ErrorDetails::ObjectId(field)) = &mut self
5698 .error_details
5699 {
5700 Some(field as _)
5701 } else {
5702 None
5703 }
5704 }
5705 pub fn object_id_mut(&mut self) -> &mut String {
5709 if self.object_id_opt_mut().is_none() {
5710 self.error_details = Some(
5711 super::execution_error::ErrorDetails::ObjectId(String::default()),
5712 );
5713 }
5714 self.object_id_opt_mut().unwrap()
5715 }
5716 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
5719 self.error_details = Some(
5720 super::execution_error::ErrorDetails::ObjectId(field.into().into()),
5721 );
5722 }
5723 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
5726 self.set_object_id(field.into());
5727 self
5728 }
5729 pub fn coin_deny_list_error(&self) -> &super::CoinDenyListError {
5731 if let Some(
5732 super::execution_error::ErrorDetails::CoinDenyListError(field),
5733 ) = &self.error_details
5734 {
5735 field as _
5736 } else {
5737 super::CoinDenyListError::default_instance() as _
5738 }
5739 }
5740 pub fn coin_deny_list_error_opt(&self) -> Option<&super::CoinDenyListError> {
5742 if let Some(
5743 super::execution_error::ErrorDetails::CoinDenyListError(field),
5744 ) = &self.error_details
5745 {
5746 Some(field as _)
5747 } else {
5748 None
5749 }
5750 }
5751 pub fn coin_deny_list_error_opt_mut(
5753 &mut self,
5754 ) -> Option<&mut super::CoinDenyListError> {
5755 if let Some(
5756 super::execution_error::ErrorDetails::CoinDenyListError(field),
5757 ) = &mut self.error_details
5758 {
5759 Some(field as _)
5760 } else {
5761 None
5762 }
5763 }
5764 pub fn coin_deny_list_error_mut(&mut self) -> &mut super::CoinDenyListError {
5768 if self.coin_deny_list_error_opt_mut().is_none() {
5769 self.error_details = Some(
5770 super::execution_error::ErrorDetails::CoinDenyListError(
5771 super::CoinDenyListError::default(),
5772 ),
5773 );
5774 }
5775 self.coin_deny_list_error_opt_mut().unwrap()
5776 }
5777 pub fn set_coin_deny_list_error<T: Into<super::CoinDenyListError>>(
5780 &mut self,
5781 field: T,
5782 ) {
5783 self.error_details = Some(
5784 super::execution_error::ErrorDetails::CoinDenyListError(
5785 field.into().into(),
5786 ),
5787 );
5788 }
5789 pub fn with_coin_deny_list_error<T: Into<super::CoinDenyListError>>(
5792 mut self,
5793 field: T,
5794 ) -> Self {
5795 self.set_coin_deny_list_error(field.into());
5796 self
5797 }
5798 pub fn congested_objects(&self) -> &super::CongestedObjects {
5800 if let Some(super::execution_error::ErrorDetails::CongestedObjects(field)) = &self
5801 .error_details
5802 {
5803 field as _
5804 } else {
5805 super::CongestedObjects::default_instance() as _
5806 }
5807 }
5808 pub fn congested_objects_opt(&self) -> Option<&super::CongestedObjects> {
5810 if let Some(super::execution_error::ErrorDetails::CongestedObjects(field)) = &self
5811 .error_details
5812 {
5813 Some(field as _)
5814 } else {
5815 None
5816 }
5817 }
5818 pub fn congested_objects_opt_mut(
5820 &mut self,
5821 ) -> Option<&mut super::CongestedObjects> {
5822 if let Some(super::execution_error::ErrorDetails::CongestedObjects(field)) = &mut self
5823 .error_details
5824 {
5825 Some(field as _)
5826 } else {
5827 None
5828 }
5829 }
5830 pub fn congested_objects_mut(&mut self) -> &mut super::CongestedObjects {
5834 if self.congested_objects_opt_mut().is_none() {
5835 self.error_details = Some(
5836 super::execution_error::ErrorDetails::CongestedObjects(
5837 super::CongestedObjects::default(),
5838 ),
5839 );
5840 }
5841 self.congested_objects_opt_mut().unwrap()
5842 }
5843 pub fn set_congested_objects<T: Into<super::CongestedObjects>>(
5846 &mut self,
5847 field: T,
5848 ) {
5849 self.error_details = Some(
5850 super::execution_error::ErrorDetails::CongestedObjects(
5851 field.into().into(),
5852 ),
5853 );
5854 }
5855 pub fn with_congested_objects<T: Into<super::CongestedObjects>>(
5858 mut self,
5859 field: T,
5860 ) -> Self {
5861 self.set_congested_objects(field.into());
5862 self
5863 }
5864 }
5865 impl super::ExecutionStatus {
5866 pub const fn const_default() -> Self {
5867 Self { success: None, error: None }
5868 }
5869 #[doc(hidden)]
5870 pub fn default_instance() -> &'static Self {
5871 static DEFAULT: super::ExecutionStatus = super::ExecutionStatus::const_default();
5872 &DEFAULT
5873 }
5874 pub fn success_opt_mut(&mut self) -> Option<&mut bool> {
5876 self.success.as_mut().map(|field| field as _)
5877 }
5878 pub fn success_mut(&mut self) -> &mut bool {
5881 self.success.get_or_insert_default()
5882 }
5883 pub fn success_opt(&self) -> Option<bool> {
5885 self.success.as_ref().map(|field| *field)
5886 }
5887 pub fn set_success<T: Into<bool>>(&mut self, field: T) {
5889 self.success = Some(field.into().into());
5890 }
5891 pub fn with_success<T: Into<bool>>(mut self, field: T) -> Self {
5893 self.set_success(field.into());
5894 self
5895 }
5896 pub fn error(&self) -> &super::ExecutionError {
5898 self.error
5899 .as_ref()
5900 .map(|field| field as _)
5901 .unwrap_or_else(|| super::ExecutionError::default_instance() as _)
5902 }
5903 pub fn error_opt_mut(&mut self) -> Option<&mut super::ExecutionError> {
5905 self.error.as_mut().map(|field| field as _)
5906 }
5907 pub fn error_mut(&mut self) -> &mut super::ExecutionError {
5910 self.error.get_or_insert_default()
5911 }
5912 pub fn error_opt(&self) -> Option<&super::ExecutionError> {
5914 self.error.as_ref().map(|field| field as _)
5915 }
5916 pub fn set_error<T: Into<super::ExecutionError>>(&mut self, field: T) {
5918 self.error = Some(field.into().into());
5919 }
5920 pub fn with_error<T: Into<super::ExecutionError>>(mut self, field: T) -> Self {
5922 self.set_error(field.into());
5923 self
5924 }
5925 }
5926 impl super::ExecutionTimeObservation {
5927 pub const fn const_default() -> Self {
5928 Self {
5929 kind: None,
5930 move_entry_point: None,
5931 validator_observations: Vec::new(),
5932 }
5933 }
5934 #[doc(hidden)]
5935 pub fn default_instance() -> &'static Self {
5936 static DEFAULT: super::ExecutionTimeObservation = super::ExecutionTimeObservation::const_default();
5937 &DEFAULT
5938 }
5939 pub fn with_kind<
5941 T: Into<super::execution_time_observation::ExecutionTimeObservationKind>,
5942 >(mut self, field: T) -> Self {
5943 self.set_kind(field.into());
5944 self
5945 }
5946 pub fn move_entry_point(&self) -> &super::MoveCall {
5948 self.move_entry_point
5949 .as_ref()
5950 .map(|field| field as _)
5951 .unwrap_or_else(|| super::MoveCall::default_instance() as _)
5952 }
5953 pub fn move_entry_point_opt_mut(&mut self) -> Option<&mut super::MoveCall> {
5955 self.move_entry_point.as_mut().map(|field| field as _)
5956 }
5957 pub fn move_entry_point_mut(&mut self) -> &mut super::MoveCall {
5960 self.move_entry_point.get_or_insert_default()
5961 }
5962 pub fn move_entry_point_opt(&self) -> Option<&super::MoveCall> {
5964 self.move_entry_point.as_ref().map(|field| field as _)
5965 }
5966 pub fn set_move_entry_point<T: Into<super::MoveCall>>(&mut self, field: T) {
5968 self.move_entry_point = Some(field.into().into());
5969 }
5970 pub fn with_move_entry_point<T: Into<super::MoveCall>>(
5972 mut self,
5973 field: T,
5974 ) -> Self {
5975 self.set_move_entry_point(field.into());
5976 self
5977 }
5978 pub fn validator_observations(
5980 &self,
5981 ) -> &[super::ValidatorExecutionTimeObservation] {
5982 &self.validator_observations
5983 }
5984 pub fn validator_observations_mut(
5987 &mut self,
5988 ) -> &mut Vec<super::ValidatorExecutionTimeObservation> {
5989 &mut self.validator_observations
5990 }
5991 pub fn set_validator_observations(
5993 &mut self,
5994 field: Vec<super::ValidatorExecutionTimeObservation>,
5995 ) {
5996 self.validator_observations = field;
5997 }
5998 pub fn with_validator_observations(
6000 mut self,
6001 field: Vec<super::ValidatorExecutionTimeObservation>,
6002 ) -> Self {
6003 self.set_validator_observations(field);
6004 self
6005 }
6006 }
6007 impl super::ExecutionTimeObservations {
6008 pub const fn const_default() -> Self {
6009 Self {
6010 version: None,
6011 observations: Vec::new(),
6012 }
6013 }
6014 #[doc(hidden)]
6015 pub fn default_instance() -> &'static Self {
6016 static DEFAULT: super::ExecutionTimeObservations = super::ExecutionTimeObservations::const_default();
6017 &DEFAULT
6018 }
6019 pub fn version_opt_mut(&mut self) -> Option<&mut i32> {
6021 self.version.as_mut().map(|field| field as _)
6022 }
6023 pub fn version_mut(&mut self) -> &mut i32 {
6026 self.version.get_or_insert_default()
6027 }
6028 pub fn version_opt(&self) -> Option<i32> {
6030 self.version.as_ref().map(|field| *field)
6031 }
6032 pub fn set_version<T: Into<i32>>(&mut self, field: T) {
6034 self.version = Some(field.into().into());
6035 }
6036 pub fn with_version<T: Into<i32>>(mut self, field: T) -> Self {
6038 self.set_version(field.into());
6039 self
6040 }
6041 pub fn observations(&self) -> &[super::ExecutionTimeObservation] {
6043 &self.observations
6044 }
6045 pub fn observations_mut(&mut self) -> &mut Vec<super::ExecutionTimeObservation> {
6048 &mut self.observations
6049 }
6050 pub fn set_observations(&mut self, field: Vec<super::ExecutionTimeObservation>) {
6052 self.observations = field;
6053 }
6054 pub fn with_observations(
6056 mut self,
6057 field: Vec<super::ExecutionTimeObservation>,
6058 ) -> Self {
6059 self.set_observations(field);
6060 self
6061 }
6062 }
6063 impl super::FieldDescriptor {
6064 pub const fn const_default() -> Self {
6065 Self {
6066 name: None,
6067 position: None,
6068 r#type: None,
6069 }
6070 }
6071 #[doc(hidden)]
6072 pub fn default_instance() -> &'static Self {
6073 static DEFAULT: super::FieldDescriptor = super::FieldDescriptor::const_default();
6074 &DEFAULT
6075 }
6076 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
6078 self.name.as_mut().map(|field| field as _)
6079 }
6080 pub fn name_mut(&mut self) -> &mut String {
6083 self.name.get_or_insert_default()
6084 }
6085 pub fn name_opt(&self) -> Option<&str> {
6087 self.name.as_ref().map(|field| field as _)
6088 }
6089 pub fn set_name<T: Into<String>>(&mut self, field: T) {
6091 self.name = Some(field.into().into());
6092 }
6093 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
6095 self.set_name(field.into());
6096 self
6097 }
6098 pub fn position_opt_mut(&mut self) -> Option<&mut u32> {
6100 self.position.as_mut().map(|field| field as _)
6101 }
6102 pub fn position_mut(&mut self) -> &mut u32 {
6105 self.position.get_or_insert_default()
6106 }
6107 pub fn position_opt(&self) -> Option<u32> {
6109 self.position.as_ref().map(|field| *field)
6110 }
6111 pub fn set_position<T: Into<u32>>(&mut self, field: T) {
6113 self.position = Some(field.into().into());
6114 }
6115 pub fn with_position<T: Into<u32>>(mut self, field: T) -> Self {
6117 self.set_position(field.into());
6118 self
6119 }
6120 pub fn r#type(&self) -> &super::OpenSignatureBody {
6122 self.r#type
6123 .as_ref()
6124 .map(|field| field as _)
6125 .unwrap_or_else(|| super::OpenSignatureBody::default_instance() as _)
6126 }
6127 pub fn type_opt_mut(&mut self) -> Option<&mut super::OpenSignatureBody> {
6129 self.r#type.as_mut().map(|field| field as _)
6130 }
6131 pub fn type_mut(&mut self) -> &mut super::OpenSignatureBody {
6134 self.r#type.get_or_insert_default()
6135 }
6136 pub fn type_opt(&self) -> Option<&super::OpenSignatureBody> {
6138 self.r#type.as_ref().map(|field| field as _)
6139 }
6140 pub fn set_type<T: Into<super::OpenSignatureBody>>(&mut self, field: T) {
6142 self.r#type = Some(field.into().into());
6143 }
6144 pub fn with_type<T: Into<super::OpenSignatureBody>>(mut self, field: T) -> Self {
6146 self.set_type(field.into());
6147 self
6148 }
6149 }
6150 impl super::FunctionDescriptor {
6151 pub const fn const_default() -> Self {
6152 Self {
6153 name: None,
6154 visibility: None,
6155 is_entry: None,
6156 type_parameters: Vec::new(),
6157 parameters: Vec::new(),
6158 returns: Vec::new(),
6159 }
6160 }
6161 #[doc(hidden)]
6162 pub fn default_instance() -> &'static Self {
6163 static DEFAULT: super::FunctionDescriptor = super::FunctionDescriptor::const_default();
6164 &DEFAULT
6165 }
6166 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
6168 self.name.as_mut().map(|field| field as _)
6169 }
6170 pub fn name_mut(&mut self) -> &mut String {
6173 self.name.get_or_insert_default()
6174 }
6175 pub fn name_opt(&self) -> Option<&str> {
6177 self.name.as_ref().map(|field| field as _)
6178 }
6179 pub fn set_name<T: Into<String>>(&mut self, field: T) {
6181 self.name = Some(field.into().into());
6182 }
6183 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
6185 self.set_name(field.into());
6186 self
6187 }
6188 pub fn with_visibility<T: Into<super::function_descriptor::Visibility>>(
6190 mut self,
6191 field: T,
6192 ) -> Self {
6193 self.set_visibility(field.into());
6194 self
6195 }
6196 pub fn is_entry_opt_mut(&mut self) -> Option<&mut bool> {
6198 self.is_entry.as_mut().map(|field| field as _)
6199 }
6200 pub fn is_entry_mut(&mut self) -> &mut bool {
6203 self.is_entry.get_or_insert_default()
6204 }
6205 pub fn is_entry_opt(&self) -> Option<bool> {
6207 self.is_entry.as_ref().map(|field| *field)
6208 }
6209 pub fn set_is_entry<T: Into<bool>>(&mut self, field: T) {
6211 self.is_entry = Some(field.into().into());
6212 }
6213 pub fn with_is_entry<T: Into<bool>>(mut self, field: T) -> Self {
6215 self.set_is_entry(field.into());
6216 self
6217 }
6218 pub fn type_parameters(&self) -> &[super::TypeParameter] {
6220 &self.type_parameters
6221 }
6222 pub fn type_parameters_mut(&mut self) -> &mut Vec<super::TypeParameter> {
6225 &mut self.type_parameters
6226 }
6227 pub fn set_type_parameters(&mut self, field: Vec<super::TypeParameter>) {
6229 self.type_parameters = field;
6230 }
6231 pub fn with_type_parameters(mut self, field: Vec<super::TypeParameter>) -> Self {
6233 self.set_type_parameters(field);
6234 self
6235 }
6236 pub fn parameters(&self) -> &[super::OpenSignature] {
6238 &self.parameters
6239 }
6240 pub fn parameters_mut(&mut self) -> &mut Vec<super::OpenSignature> {
6243 &mut self.parameters
6244 }
6245 pub fn set_parameters(&mut self, field: Vec<super::OpenSignature>) {
6247 self.parameters = field;
6248 }
6249 pub fn with_parameters(mut self, field: Vec<super::OpenSignature>) -> Self {
6251 self.set_parameters(field);
6252 self
6253 }
6254 pub fn returns(&self) -> &[super::OpenSignature] {
6256 &self.returns
6257 }
6258 pub fn returns_mut(&mut self) -> &mut Vec<super::OpenSignature> {
6261 &mut self.returns
6262 }
6263 pub fn set_returns(&mut self, field: Vec<super::OpenSignature>) {
6265 self.returns = field;
6266 }
6267 pub fn with_returns(mut self, field: Vec<super::OpenSignature>) -> Self {
6269 self.set_returns(field);
6270 self
6271 }
6272 }
6273 impl super::GasCostSummary {
6274 pub const fn const_default() -> Self {
6275 Self {
6276 computation_cost: None,
6277 storage_cost: None,
6278 storage_rebate: None,
6279 non_refundable_storage_fee: None,
6280 }
6281 }
6282 #[doc(hidden)]
6283 pub fn default_instance() -> &'static Self {
6284 static DEFAULT: super::GasCostSummary = super::GasCostSummary::const_default();
6285 &DEFAULT
6286 }
6287 pub fn computation_cost_opt_mut(&mut self) -> Option<&mut u64> {
6289 self.computation_cost.as_mut().map(|field| field as _)
6290 }
6291 pub fn computation_cost_mut(&mut self) -> &mut u64 {
6294 self.computation_cost.get_or_insert_default()
6295 }
6296 pub fn computation_cost_opt(&self) -> Option<u64> {
6298 self.computation_cost.as_ref().map(|field| *field)
6299 }
6300 pub fn set_computation_cost<T: Into<u64>>(&mut self, field: T) {
6302 self.computation_cost = Some(field.into().into());
6303 }
6304 pub fn with_computation_cost<T: Into<u64>>(mut self, field: T) -> Self {
6306 self.set_computation_cost(field.into());
6307 self
6308 }
6309 pub fn storage_cost_opt_mut(&mut self) -> Option<&mut u64> {
6311 self.storage_cost.as_mut().map(|field| field as _)
6312 }
6313 pub fn storage_cost_mut(&mut self) -> &mut u64 {
6316 self.storage_cost.get_or_insert_default()
6317 }
6318 pub fn storage_cost_opt(&self) -> Option<u64> {
6320 self.storage_cost.as_ref().map(|field| *field)
6321 }
6322 pub fn set_storage_cost<T: Into<u64>>(&mut self, field: T) {
6324 self.storage_cost = Some(field.into().into());
6325 }
6326 pub fn with_storage_cost<T: Into<u64>>(mut self, field: T) -> Self {
6328 self.set_storage_cost(field.into());
6329 self
6330 }
6331 pub fn storage_rebate_opt_mut(&mut self) -> Option<&mut u64> {
6333 self.storage_rebate.as_mut().map(|field| field as _)
6334 }
6335 pub fn storage_rebate_mut(&mut self) -> &mut u64 {
6338 self.storage_rebate.get_or_insert_default()
6339 }
6340 pub fn storage_rebate_opt(&self) -> Option<u64> {
6342 self.storage_rebate.as_ref().map(|field| *field)
6343 }
6344 pub fn set_storage_rebate<T: Into<u64>>(&mut self, field: T) {
6346 self.storage_rebate = Some(field.into().into());
6347 }
6348 pub fn with_storage_rebate<T: Into<u64>>(mut self, field: T) -> Self {
6350 self.set_storage_rebate(field.into());
6351 self
6352 }
6353 pub fn non_refundable_storage_fee_opt_mut(&mut self) -> Option<&mut u64> {
6355 self.non_refundable_storage_fee.as_mut().map(|field| field as _)
6356 }
6357 pub fn non_refundable_storage_fee_mut(&mut self) -> &mut u64 {
6360 self.non_refundable_storage_fee.get_or_insert_default()
6361 }
6362 pub fn non_refundable_storage_fee_opt(&self) -> Option<u64> {
6364 self.non_refundable_storage_fee.as_ref().map(|field| *field)
6365 }
6366 pub fn set_non_refundable_storage_fee<T: Into<u64>>(&mut self, field: T) {
6368 self.non_refundable_storage_fee = Some(field.into().into());
6369 }
6370 pub fn with_non_refundable_storage_fee<T: Into<u64>>(
6372 mut self,
6373 field: T,
6374 ) -> Self {
6375 self.set_non_refundable_storage_fee(field.into());
6376 self
6377 }
6378 }
6379 impl super::GasPayment {
6380 pub const fn const_default() -> Self {
6381 Self {
6382 objects: Vec::new(),
6383 owner: None,
6384 price: None,
6385 budget: None,
6386 }
6387 }
6388 #[doc(hidden)]
6389 pub fn default_instance() -> &'static Self {
6390 static DEFAULT: super::GasPayment = super::GasPayment::const_default();
6391 &DEFAULT
6392 }
6393 pub fn objects(&self) -> &[super::ObjectReference] {
6395 &self.objects
6396 }
6397 pub fn objects_mut(&mut self) -> &mut Vec<super::ObjectReference> {
6400 &mut self.objects
6401 }
6402 pub fn set_objects(&mut self, field: Vec<super::ObjectReference>) {
6404 self.objects = field;
6405 }
6406 pub fn with_objects(mut self, field: Vec<super::ObjectReference>) -> Self {
6408 self.set_objects(field);
6409 self
6410 }
6411 pub fn owner_opt_mut(&mut self) -> Option<&mut String> {
6413 self.owner.as_mut().map(|field| field as _)
6414 }
6415 pub fn owner_mut(&mut self) -> &mut String {
6418 self.owner.get_or_insert_default()
6419 }
6420 pub fn owner_opt(&self) -> Option<&str> {
6422 self.owner.as_ref().map(|field| field as _)
6423 }
6424 pub fn set_owner<T: Into<String>>(&mut self, field: T) {
6426 self.owner = Some(field.into().into());
6427 }
6428 pub fn with_owner<T: Into<String>>(mut self, field: T) -> Self {
6430 self.set_owner(field.into());
6431 self
6432 }
6433 pub fn price_opt_mut(&mut self) -> Option<&mut u64> {
6435 self.price.as_mut().map(|field| field as _)
6436 }
6437 pub fn price_mut(&mut self) -> &mut u64 {
6440 self.price.get_or_insert_default()
6441 }
6442 pub fn price_opt(&self) -> Option<u64> {
6444 self.price.as_ref().map(|field| *field)
6445 }
6446 pub fn set_price<T: Into<u64>>(&mut self, field: T) {
6448 self.price = Some(field.into().into());
6449 }
6450 pub fn with_price<T: Into<u64>>(mut self, field: T) -> Self {
6452 self.set_price(field.into());
6453 self
6454 }
6455 pub fn budget_opt_mut(&mut self) -> Option<&mut u64> {
6457 self.budget.as_mut().map(|field| field as _)
6458 }
6459 pub fn budget_mut(&mut self) -> &mut u64 {
6462 self.budget.get_or_insert_default()
6463 }
6464 pub fn budget_opt(&self) -> Option<u64> {
6466 self.budget.as_ref().map(|field| *field)
6467 }
6468 pub fn set_budget<T: Into<u64>>(&mut self, field: T) {
6470 self.budget = Some(field.into().into());
6471 }
6472 pub fn with_budget<T: Into<u64>>(mut self, field: T) -> Self {
6474 self.set_budget(field.into());
6475 self
6476 }
6477 }
6478 impl super::GenesisTransaction {
6479 pub const fn const_default() -> Self {
6480 Self { objects: Vec::new() }
6481 }
6482 #[doc(hidden)]
6483 pub fn default_instance() -> &'static Self {
6484 static DEFAULT: super::GenesisTransaction = super::GenesisTransaction::const_default();
6485 &DEFAULT
6486 }
6487 pub fn objects(&self) -> &[super::Object] {
6489 &self.objects
6490 }
6491 pub fn objects_mut(&mut self) -> &mut Vec<super::Object> {
6494 &mut self.objects
6495 }
6496 pub fn set_objects(&mut self, field: Vec<super::Object>) {
6498 self.objects = field;
6499 }
6500 pub fn with_objects(mut self, field: Vec<super::Object>) -> Self {
6502 self.set_objects(field);
6503 self
6504 }
6505 }
6506 impl super::GetBalanceRequest {
6507 pub const fn const_default() -> Self {
6508 Self {
6509 owner: None,
6510 coin_type: None,
6511 }
6512 }
6513 #[doc(hidden)]
6514 pub fn default_instance() -> &'static Self {
6515 static DEFAULT: super::GetBalanceRequest = super::GetBalanceRequest::const_default();
6516 &DEFAULT
6517 }
6518 pub fn owner_opt_mut(&mut self) -> Option<&mut String> {
6520 self.owner.as_mut().map(|field| field as _)
6521 }
6522 pub fn owner_mut(&mut self) -> &mut String {
6525 self.owner.get_or_insert_default()
6526 }
6527 pub fn owner_opt(&self) -> Option<&str> {
6529 self.owner.as_ref().map(|field| field as _)
6530 }
6531 pub fn set_owner<T: Into<String>>(&mut self, field: T) {
6533 self.owner = Some(field.into().into());
6534 }
6535 pub fn with_owner<T: Into<String>>(mut self, field: T) -> Self {
6537 self.set_owner(field.into());
6538 self
6539 }
6540 pub fn coin_type_opt_mut(&mut self) -> Option<&mut String> {
6542 self.coin_type.as_mut().map(|field| field as _)
6543 }
6544 pub fn coin_type_mut(&mut self) -> &mut String {
6547 self.coin_type.get_or_insert_default()
6548 }
6549 pub fn coin_type_opt(&self) -> Option<&str> {
6551 self.coin_type.as_ref().map(|field| field as _)
6552 }
6553 pub fn set_coin_type<T: Into<String>>(&mut self, field: T) {
6555 self.coin_type = Some(field.into().into());
6556 }
6557 pub fn with_coin_type<T: Into<String>>(mut self, field: T) -> Self {
6559 self.set_coin_type(field.into());
6560 self
6561 }
6562 }
6563 impl super::GetBalanceResponse {
6564 pub const fn const_default() -> Self {
6565 Self { balance: None }
6566 }
6567 #[doc(hidden)]
6568 pub fn default_instance() -> &'static Self {
6569 static DEFAULT: super::GetBalanceResponse = super::GetBalanceResponse::const_default();
6570 &DEFAULT
6571 }
6572 pub fn balance(&self) -> &super::Balance {
6574 self.balance
6575 .as_ref()
6576 .map(|field| field as _)
6577 .unwrap_or_else(|| super::Balance::default_instance() as _)
6578 }
6579 pub fn balance_opt_mut(&mut self) -> Option<&mut super::Balance> {
6581 self.balance.as_mut().map(|field| field as _)
6582 }
6583 pub fn balance_mut(&mut self) -> &mut super::Balance {
6586 self.balance.get_or_insert_default()
6587 }
6588 pub fn balance_opt(&self) -> Option<&super::Balance> {
6590 self.balance.as_ref().map(|field| field as _)
6591 }
6592 pub fn set_balance<T: Into<super::Balance>>(&mut self, field: T) {
6594 self.balance = Some(field.into().into());
6595 }
6596 pub fn with_balance<T: Into<super::Balance>>(mut self, field: T) -> Self {
6598 self.set_balance(field.into());
6599 self
6600 }
6601 }
6602 impl super::GetCheckpointRequest {
6603 pub const fn const_default() -> Self {
6604 Self {
6605 read_mask: None,
6606 checkpoint_id: None,
6607 }
6608 }
6609 #[doc(hidden)]
6610 pub fn default_instance() -> &'static Self {
6611 static DEFAULT: super::GetCheckpointRequest = super::GetCheckpointRequest::const_default();
6612 &DEFAULT
6613 }
6614 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
6616 self.read_mask.as_mut().map(|field| field as _)
6617 }
6618 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
6621 self.read_mask.get_or_insert_default()
6622 }
6623 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
6625 self.read_mask.as_ref().map(|field| field as _)
6626 }
6627 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
6629 self.read_mask = Some(field.into().into());
6630 }
6631 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
6633 mut self,
6634 field: T,
6635 ) -> Self {
6636 self.set_read_mask(field.into());
6637 self
6638 }
6639 pub fn sequence_number(&self) -> u64 {
6641 if let Some(
6642 super::get_checkpoint_request::CheckpointId::SequenceNumber(field),
6643 ) = &self.checkpoint_id
6644 {
6645 *field
6646 } else {
6647 0u64
6648 }
6649 }
6650 pub fn sequence_number_opt(&self) -> Option<u64> {
6652 if let Some(
6653 super::get_checkpoint_request::CheckpointId::SequenceNumber(field),
6654 ) = &self.checkpoint_id
6655 {
6656 Some(*field)
6657 } else {
6658 None
6659 }
6660 }
6661 pub fn sequence_number_opt_mut(&mut self) -> Option<&mut u64> {
6663 if let Some(
6664 super::get_checkpoint_request::CheckpointId::SequenceNumber(field),
6665 ) = &mut self.checkpoint_id
6666 {
6667 Some(field as _)
6668 } else {
6669 None
6670 }
6671 }
6672 pub fn sequence_number_mut(&mut self) -> &mut u64 {
6676 if self.sequence_number_opt_mut().is_none() {
6677 self.checkpoint_id = Some(
6678 super::get_checkpoint_request::CheckpointId::SequenceNumber(
6679 u64::default(),
6680 ),
6681 );
6682 }
6683 self.sequence_number_opt_mut().unwrap()
6684 }
6685 pub fn set_sequence_number<T: Into<u64>>(&mut self, field: T) {
6688 self.checkpoint_id = Some(
6689 super::get_checkpoint_request::CheckpointId::SequenceNumber(
6690 field.into().into(),
6691 ),
6692 );
6693 }
6694 pub fn with_sequence_number<T: Into<u64>>(mut self, field: T) -> Self {
6697 self.set_sequence_number(field.into());
6698 self
6699 }
6700 pub fn digest(&self) -> &str {
6702 if let Some(super::get_checkpoint_request::CheckpointId::Digest(field)) = &self
6703 .checkpoint_id
6704 {
6705 field as _
6706 } else {
6707 ""
6708 }
6709 }
6710 pub fn digest_opt(&self) -> Option<&str> {
6712 if let Some(super::get_checkpoint_request::CheckpointId::Digest(field)) = &self
6713 .checkpoint_id
6714 {
6715 Some(field as _)
6716 } else {
6717 None
6718 }
6719 }
6720 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
6722 if let Some(super::get_checkpoint_request::CheckpointId::Digest(field)) = &mut self
6723 .checkpoint_id
6724 {
6725 Some(field as _)
6726 } else {
6727 None
6728 }
6729 }
6730 pub fn digest_mut(&mut self) -> &mut String {
6734 if self.digest_opt_mut().is_none() {
6735 self.checkpoint_id = Some(
6736 super::get_checkpoint_request::CheckpointId::Digest(
6737 String::default(),
6738 ),
6739 );
6740 }
6741 self.digest_opt_mut().unwrap()
6742 }
6743 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
6746 self.checkpoint_id = Some(
6747 super::get_checkpoint_request::CheckpointId::Digest(field.into().into()),
6748 );
6749 }
6750 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
6753 self.set_digest(field.into());
6754 self
6755 }
6756 }
6757 impl super::GetCheckpointResponse {
6758 pub const fn const_default() -> Self {
6759 Self { checkpoint: None }
6760 }
6761 #[doc(hidden)]
6762 pub fn default_instance() -> &'static Self {
6763 static DEFAULT: super::GetCheckpointResponse = super::GetCheckpointResponse::const_default();
6764 &DEFAULT
6765 }
6766 pub fn checkpoint(&self) -> &super::Checkpoint {
6768 self.checkpoint
6769 .as_ref()
6770 .map(|field| field as _)
6771 .unwrap_or_else(|| super::Checkpoint::default_instance() as _)
6772 }
6773 pub fn checkpoint_opt_mut(&mut self) -> Option<&mut super::Checkpoint> {
6775 self.checkpoint.as_mut().map(|field| field as _)
6776 }
6777 pub fn checkpoint_mut(&mut self) -> &mut super::Checkpoint {
6780 self.checkpoint.get_or_insert_default()
6781 }
6782 pub fn checkpoint_opt(&self) -> Option<&super::Checkpoint> {
6784 self.checkpoint.as_ref().map(|field| field as _)
6785 }
6786 pub fn set_checkpoint<T: Into<super::Checkpoint>>(&mut self, field: T) {
6788 self.checkpoint = Some(field.into().into());
6789 }
6790 pub fn with_checkpoint<T: Into<super::Checkpoint>>(mut self, field: T) -> Self {
6792 self.set_checkpoint(field.into());
6793 self
6794 }
6795 }
6796 impl super::GetCoinInfoRequest {
6797 pub const fn const_default() -> Self {
6798 Self { coin_type: None }
6799 }
6800 #[doc(hidden)]
6801 pub fn default_instance() -> &'static Self {
6802 static DEFAULT: super::GetCoinInfoRequest = super::GetCoinInfoRequest::const_default();
6803 &DEFAULT
6804 }
6805 pub fn coin_type_opt_mut(&mut self) -> Option<&mut String> {
6807 self.coin_type.as_mut().map(|field| field as _)
6808 }
6809 pub fn coin_type_mut(&mut self) -> &mut String {
6812 self.coin_type.get_or_insert_default()
6813 }
6814 pub fn coin_type_opt(&self) -> Option<&str> {
6816 self.coin_type.as_ref().map(|field| field as _)
6817 }
6818 pub fn set_coin_type<T: Into<String>>(&mut self, field: T) {
6820 self.coin_type = Some(field.into().into());
6821 }
6822 pub fn with_coin_type<T: Into<String>>(mut self, field: T) -> Self {
6824 self.set_coin_type(field.into());
6825 self
6826 }
6827 }
6828 impl super::GetCoinInfoResponse {
6829 pub const fn const_default() -> Self {
6830 Self {
6831 coin_type: None,
6832 metadata: None,
6833 treasury: None,
6834 regulated_metadata: None,
6835 }
6836 }
6837 #[doc(hidden)]
6838 pub fn default_instance() -> &'static Self {
6839 static DEFAULT: super::GetCoinInfoResponse = super::GetCoinInfoResponse::const_default();
6840 &DEFAULT
6841 }
6842 pub fn coin_type_opt_mut(&mut self) -> Option<&mut String> {
6844 self.coin_type.as_mut().map(|field| field as _)
6845 }
6846 pub fn coin_type_mut(&mut self) -> &mut String {
6849 self.coin_type.get_or_insert_default()
6850 }
6851 pub fn coin_type_opt(&self) -> Option<&str> {
6853 self.coin_type.as_ref().map(|field| field as _)
6854 }
6855 pub fn set_coin_type<T: Into<String>>(&mut self, field: T) {
6857 self.coin_type = Some(field.into().into());
6858 }
6859 pub fn with_coin_type<T: Into<String>>(mut self, field: T) -> Self {
6861 self.set_coin_type(field.into());
6862 self
6863 }
6864 pub fn metadata(&self) -> &super::CoinMetadata {
6866 self.metadata
6867 .as_ref()
6868 .map(|field| field as _)
6869 .unwrap_or_else(|| super::CoinMetadata::default_instance() as _)
6870 }
6871 pub fn metadata_opt_mut(&mut self) -> Option<&mut super::CoinMetadata> {
6873 self.metadata.as_mut().map(|field| field as _)
6874 }
6875 pub fn metadata_mut(&mut self) -> &mut super::CoinMetadata {
6878 self.metadata.get_or_insert_default()
6879 }
6880 pub fn metadata_opt(&self) -> Option<&super::CoinMetadata> {
6882 self.metadata.as_ref().map(|field| field as _)
6883 }
6884 pub fn set_metadata<T: Into<super::CoinMetadata>>(&mut self, field: T) {
6886 self.metadata = Some(field.into().into());
6887 }
6888 pub fn with_metadata<T: Into<super::CoinMetadata>>(mut self, field: T) -> Self {
6890 self.set_metadata(field.into());
6891 self
6892 }
6893 pub fn treasury(&self) -> &super::CoinTreasury {
6895 self.treasury
6896 .as_ref()
6897 .map(|field| field as _)
6898 .unwrap_or_else(|| super::CoinTreasury::default_instance() as _)
6899 }
6900 pub fn treasury_opt_mut(&mut self) -> Option<&mut super::CoinTreasury> {
6902 self.treasury.as_mut().map(|field| field as _)
6903 }
6904 pub fn treasury_mut(&mut self) -> &mut super::CoinTreasury {
6907 self.treasury.get_or_insert_default()
6908 }
6909 pub fn treasury_opt(&self) -> Option<&super::CoinTreasury> {
6911 self.treasury.as_ref().map(|field| field as _)
6912 }
6913 pub fn set_treasury<T: Into<super::CoinTreasury>>(&mut self, field: T) {
6915 self.treasury = Some(field.into().into());
6916 }
6917 pub fn with_treasury<T: Into<super::CoinTreasury>>(mut self, field: T) -> Self {
6919 self.set_treasury(field.into());
6920 self
6921 }
6922 pub fn regulated_metadata(&self) -> &super::RegulatedCoinMetadata {
6924 self.regulated_metadata
6925 .as_ref()
6926 .map(|field| field as _)
6927 .unwrap_or_else(|| super::RegulatedCoinMetadata::default_instance() as _)
6928 }
6929 pub fn regulated_metadata_opt_mut(
6931 &mut self,
6932 ) -> Option<&mut super::RegulatedCoinMetadata> {
6933 self.regulated_metadata.as_mut().map(|field| field as _)
6934 }
6935 pub fn regulated_metadata_mut(&mut self) -> &mut super::RegulatedCoinMetadata {
6938 self.regulated_metadata.get_or_insert_default()
6939 }
6940 pub fn regulated_metadata_opt(&self) -> Option<&super::RegulatedCoinMetadata> {
6942 self.regulated_metadata.as_ref().map(|field| field as _)
6943 }
6944 pub fn set_regulated_metadata<T: Into<super::RegulatedCoinMetadata>>(
6946 &mut self,
6947 field: T,
6948 ) {
6949 self.regulated_metadata = Some(field.into().into());
6950 }
6951 pub fn with_regulated_metadata<T: Into<super::RegulatedCoinMetadata>>(
6953 mut self,
6954 field: T,
6955 ) -> Self {
6956 self.set_regulated_metadata(field.into());
6957 self
6958 }
6959 }
6960 impl super::GetDatatypeRequest {
6961 pub const fn const_default() -> Self {
6962 Self {
6963 package_id: None,
6964 module_name: None,
6965 name: None,
6966 }
6967 }
6968 #[doc(hidden)]
6969 pub fn default_instance() -> &'static Self {
6970 static DEFAULT: super::GetDatatypeRequest = super::GetDatatypeRequest::const_default();
6971 &DEFAULT
6972 }
6973 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
6975 self.package_id.as_mut().map(|field| field as _)
6976 }
6977 pub fn package_id_mut(&mut self) -> &mut String {
6980 self.package_id.get_or_insert_default()
6981 }
6982 pub fn package_id_opt(&self) -> Option<&str> {
6984 self.package_id.as_ref().map(|field| field as _)
6985 }
6986 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
6988 self.package_id = Some(field.into().into());
6989 }
6990 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
6992 self.set_package_id(field.into());
6993 self
6994 }
6995 pub fn module_name_opt_mut(&mut self) -> Option<&mut String> {
6997 self.module_name.as_mut().map(|field| field as _)
6998 }
6999 pub fn module_name_mut(&mut self) -> &mut String {
7002 self.module_name.get_or_insert_default()
7003 }
7004 pub fn module_name_opt(&self) -> Option<&str> {
7006 self.module_name.as_ref().map(|field| field as _)
7007 }
7008 pub fn set_module_name<T: Into<String>>(&mut self, field: T) {
7010 self.module_name = Some(field.into().into());
7011 }
7012 pub fn with_module_name<T: Into<String>>(mut self, field: T) -> Self {
7014 self.set_module_name(field.into());
7015 self
7016 }
7017 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
7019 self.name.as_mut().map(|field| field as _)
7020 }
7021 pub fn name_mut(&mut self) -> &mut String {
7024 self.name.get_or_insert_default()
7025 }
7026 pub fn name_opt(&self) -> Option<&str> {
7028 self.name.as_ref().map(|field| field as _)
7029 }
7030 pub fn set_name<T: Into<String>>(&mut self, field: T) {
7032 self.name = Some(field.into().into());
7033 }
7034 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
7036 self.set_name(field.into());
7037 self
7038 }
7039 }
7040 impl super::GetDatatypeResponse {
7041 pub const fn const_default() -> Self {
7042 Self { datatype: None }
7043 }
7044 #[doc(hidden)]
7045 pub fn default_instance() -> &'static Self {
7046 static DEFAULT: super::GetDatatypeResponse = super::GetDatatypeResponse::const_default();
7047 &DEFAULT
7048 }
7049 pub fn datatype(&self) -> &super::DatatypeDescriptor {
7051 self.datatype
7052 .as_ref()
7053 .map(|field| field as _)
7054 .unwrap_or_else(|| super::DatatypeDescriptor::default_instance() as _)
7055 }
7056 pub fn datatype_opt_mut(&mut self) -> Option<&mut super::DatatypeDescriptor> {
7058 self.datatype.as_mut().map(|field| field as _)
7059 }
7060 pub fn datatype_mut(&mut self) -> &mut super::DatatypeDescriptor {
7063 self.datatype.get_or_insert_default()
7064 }
7065 pub fn datatype_opt(&self) -> Option<&super::DatatypeDescriptor> {
7067 self.datatype.as_ref().map(|field| field as _)
7068 }
7069 pub fn set_datatype<T: Into<super::DatatypeDescriptor>>(&mut self, field: T) {
7071 self.datatype = Some(field.into().into());
7072 }
7073 pub fn with_datatype<T: Into<super::DatatypeDescriptor>>(
7075 mut self,
7076 field: T,
7077 ) -> Self {
7078 self.set_datatype(field.into());
7079 self
7080 }
7081 }
7082 impl super::GetEpochRequest {
7083 pub const fn const_default() -> Self {
7084 Self {
7085 epoch: None,
7086 read_mask: None,
7087 }
7088 }
7089 #[doc(hidden)]
7090 pub fn default_instance() -> &'static Self {
7091 static DEFAULT: super::GetEpochRequest = super::GetEpochRequest::const_default();
7092 &DEFAULT
7093 }
7094 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
7096 self.epoch.as_mut().map(|field| field as _)
7097 }
7098 pub fn epoch_mut(&mut self) -> &mut u64 {
7101 self.epoch.get_or_insert_default()
7102 }
7103 pub fn epoch_opt(&self) -> Option<u64> {
7105 self.epoch.as_ref().map(|field| *field)
7106 }
7107 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
7109 self.epoch = Some(field.into().into());
7110 }
7111 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
7113 self.set_epoch(field.into());
7114 self
7115 }
7116 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
7118 self.read_mask.as_mut().map(|field| field as _)
7119 }
7120 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
7123 self.read_mask.get_or_insert_default()
7124 }
7125 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
7127 self.read_mask.as_ref().map(|field| field as _)
7128 }
7129 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
7131 self.read_mask = Some(field.into().into());
7132 }
7133 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
7135 mut self,
7136 field: T,
7137 ) -> Self {
7138 self.set_read_mask(field.into());
7139 self
7140 }
7141 }
7142 impl super::GetEpochResponse {
7143 pub const fn const_default() -> Self {
7144 Self { epoch: None }
7145 }
7146 #[doc(hidden)]
7147 pub fn default_instance() -> &'static Self {
7148 static DEFAULT: super::GetEpochResponse = super::GetEpochResponse::const_default();
7149 &DEFAULT
7150 }
7151 pub fn epoch(&self) -> &super::Epoch {
7153 self.epoch
7154 .as_ref()
7155 .map(|field| field as _)
7156 .unwrap_or_else(|| super::Epoch::default_instance() as _)
7157 }
7158 pub fn epoch_opt_mut(&mut self) -> Option<&mut super::Epoch> {
7160 self.epoch.as_mut().map(|field| field as _)
7161 }
7162 pub fn epoch_mut(&mut self) -> &mut super::Epoch {
7165 self.epoch.get_or_insert_default()
7166 }
7167 pub fn epoch_opt(&self) -> Option<&super::Epoch> {
7169 self.epoch.as_ref().map(|field| field as _)
7170 }
7171 pub fn set_epoch<T: Into<super::Epoch>>(&mut self, field: T) {
7173 self.epoch = Some(field.into().into());
7174 }
7175 pub fn with_epoch<T: Into<super::Epoch>>(mut self, field: T) -> Self {
7177 self.set_epoch(field.into());
7178 self
7179 }
7180 }
7181 impl super::GetFunctionRequest {
7182 pub const fn const_default() -> Self {
7183 Self {
7184 package_id: None,
7185 module_name: None,
7186 name: None,
7187 }
7188 }
7189 #[doc(hidden)]
7190 pub fn default_instance() -> &'static Self {
7191 static DEFAULT: super::GetFunctionRequest = super::GetFunctionRequest::const_default();
7192 &DEFAULT
7193 }
7194 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
7196 self.package_id.as_mut().map(|field| field as _)
7197 }
7198 pub fn package_id_mut(&mut self) -> &mut String {
7201 self.package_id.get_or_insert_default()
7202 }
7203 pub fn package_id_opt(&self) -> Option<&str> {
7205 self.package_id.as_ref().map(|field| field as _)
7206 }
7207 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
7209 self.package_id = Some(field.into().into());
7210 }
7211 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
7213 self.set_package_id(field.into());
7214 self
7215 }
7216 pub fn module_name_opt_mut(&mut self) -> Option<&mut String> {
7218 self.module_name.as_mut().map(|field| field as _)
7219 }
7220 pub fn module_name_mut(&mut self) -> &mut String {
7223 self.module_name.get_or_insert_default()
7224 }
7225 pub fn module_name_opt(&self) -> Option<&str> {
7227 self.module_name.as_ref().map(|field| field as _)
7228 }
7229 pub fn set_module_name<T: Into<String>>(&mut self, field: T) {
7231 self.module_name = Some(field.into().into());
7232 }
7233 pub fn with_module_name<T: Into<String>>(mut self, field: T) -> Self {
7235 self.set_module_name(field.into());
7236 self
7237 }
7238 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
7240 self.name.as_mut().map(|field| field as _)
7241 }
7242 pub fn name_mut(&mut self) -> &mut String {
7245 self.name.get_or_insert_default()
7246 }
7247 pub fn name_opt(&self) -> Option<&str> {
7249 self.name.as_ref().map(|field| field as _)
7250 }
7251 pub fn set_name<T: Into<String>>(&mut self, field: T) {
7253 self.name = Some(field.into().into());
7254 }
7255 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
7257 self.set_name(field.into());
7258 self
7259 }
7260 }
7261 impl super::GetFunctionResponse {
7262 pub const fn const_default() -> Self {
7263 Self { function: None }
7264 }
7265 #[doc(hidden)]
7266 pub fn default_instance() -> &'static Self {
7267 static DEFAULT: super::GetFunctionResponse = super::GetFunctionResponse::const_default();
7268 &DEFAULT
7269 }
7270 pub fn function(&self) -> &super::FunctionDescriptor {
7272 self.function
7273 .as_ref()
7274 .map(|field| field as _)
7275 .unwrap_or_else(|| super::FunctionDescriptor::default_instance() as _)
7276 }
7277 pub fn function_opt_mut(&mut self) -> Option<&mut super::FunctionDescriptor> {
7279 self.function.as_mut().map(|field| field as _)
7280 }
7281 pub fn function_mut(&mut self) -> &mut super::FunctionDescriptor {
7284 self.function.get_or_insert_default()
7285 }
7286 pub fn function_opt(&self) -> Option<&super::FunctionDescriptor> {
7288 self.function.as_ref().map(|field| field as _)
7289 }
7290 pub fn set_function<T: Into<super::FunctionDescriptor>>(&mut self, field: T) {
7292 self.function = Some(field.into().into());
7293 }
7294 pub fn with_function<T: Into<super::FunctionDescriptor>>(
7296 mut self,
7297 field: T,
7298 ) -> Self {
7299 self.set_function(field.into());
7300 self
7301 }
7302 }
7303 impl super::GetObjectRequest {
7304 pub const fn const_default() -> Self {
7305 Self {
7306 object_id: None,
7307 version: None,
7308 read_mask: None,
7309 }
7310 }
7311 #[doc(hidden)]
7312 pub fn default_instance() -> &'static Self {
7313 static DEFAULT: super::GetObjectRequest = super::GetObjectRequest::const_default();
7314 &DEFAULT
7315 }
7316 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
7318 self.object_id.as_mut().map(|field| field as _)
7319 }
7320 pub fn object_id_mut(&mut self) -> &mut String {
7323 self.object_id.get_or_insert_default()
7324 }
7325 pub fn object_id_opt(&self) -> Option<&str> {
7327 self.object_id.as_ref().map(|field| field as _)
7328 }
7329 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
7331 self.object_id = Some(field.into().into());
7332 }
7333 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
7335 self.set_object_id(field.into());
7336 self
7337 }
7338 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
7340 self.version.as_mut().map(|field| field as _)
7341 }
7342 pub fn version_mut(&mut self) -> &mut u64 {
7345 self.version.get_or_insert_default()
7346 }
7347 pub fn version_opt(&self) -> Option<u64> {
7349 self.version.as_ref().map(|field| *field)
7350 }
7351 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
7353 self.version = Some(field.into().into());
7354 }
7355 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
7357 self.set_version(field.into());
7358 self
7359 }
7360 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
7362 self.read_mask.as_mut().map(|field| field as _)
7363 }
7364 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
7367 self.read_mask.get_or_insert_default()
7368 }
7369 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
7371 self.read_mask.as_ref().map(|field| field as _)
7372 }
7373 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
7375 self.read_mask = Some(field.into().into());
7376 }
7377 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
7379 mut self,
7380 field: T,
7381 ) -> Self {
7382 self.set_read_mask(field.into());
7383 self
7384 }
7385 }
7386 impl super::GetObjectResponse {
7387 pub const fn const_default() -> Self {
7388 Self { object: None }
7389 }
7390 #[doc(hidden)]
7391 pub fn default_instance() -> &'static Self {
7392 static DEFAULT: super::GetObjectResponse = super::GetObjectResponse::const_default();
7393 &DEFAULT
7394 }
7395 pub fn object(&self) -> &super::Object {
7397 self.object
7398 .as_ref()
7399 .map(|field| field as _)
7400 .unwrap_or_else(|| super::Object::default_instance() as _)
7401 }
7402 pub fn object_opt_mut(&mut self) -> Option<&mut super::Object> {
7404 self.object.as_mut().map(|field| field as _)
7405 }
7406 pub fn object_mut(&mut self) -> &mut super::Object {
7409 self.object.get_or_insert_default()
7410 }
7411 pub fn object_opt(&self) -> Option<&super::Object> {
7413 self.object.as_ref().map(|field| field as _)
7414 }
7415 pub fn set_object<T: Into<super::Object>>(&mut self, field: T) {
7417 self.object = Some(field.into().into());
7418 }
7419 pub fn with_object<T: Into<super::Object>>(mut self, field: T) -> Self {
7421 self.set_object(field.into());
7422 self
7423 }
7424 }
7425 impl super::GetObjectResult {
7426 pub const fn const_default() -> Self {
7427 Self { result: None }
7428 }
7429 #[doc(hidden)]
7430 pub fn default_instance() -> &'static Self {
7431 static DEFAULT: super::GetObjectResult = super::GetObjectResult::const_default();
7432 &DEFAULT
7433 }
7434 pub fn object(&self) -> &super::Object {
7436 if let Some(super::get_object_result::Result::Object(field)) = &self.result {
7437 field as _
7438 } else {
7439 super::Object::default_instance() as _
7440 }
7441 }
7442 pub fn object_opt(&self) -> Option<&super::Object> {
7444 if let Some(super::get_object_result::Result::Object(field)) = &self.result {
7445 Some(field as _)
7446 } else {
7447 None
7448 }
7449 }
7450 pub fn object_opt_mut(&mut self) -> Option<&mut super::Object> {
7452 if let Some(super::get_object_result::Result::Object(field)) = &mut self
7453 .result
7454 {
7455 Some(field as _)
7456 } else {
7457 None
7458 }
7459 }
7460 pub fn object_mut(&mut self) -> &mut super::Object {
7464 if self.object_opt_mut().is_none() {
7465 self.result = Some(
7466 super::get_object_result::Result::Object(super::Object::default()),
7467 );
7468 }
7469 self.object_opt_mut().unwrap()
7470 }
7471 pub fn set_object<T: Into<super::Object>>(&mut self, field: T) {
7474 self.result = Some(
7475 super::get_object_result::Result::Object(field.into().into()),
7476 );
7477 }
7478 pub fn with_object<T: Into<super::Object>>(mut self, field: T) -> Self {
7481 self.set_object(field.into());
7482 self
7483 }
7484 pub fn error(&self) -> &super::super::super::super::google::rpc::Status {
7486 if let Some(super::get_object_result::Result::Error(field)) = &self.result {
7487 field as _
7488 } else {
7489 super::super::super::super::google::rpc::Status::default_instance() as _
7490 }
7491 }
7492 pub fn error_opt(
7494 &self,
7495 ) -> Option<&super::super::super::super::google::rpc::Status> {
7496 if let Some(super::get_object_result::Result::Error(field)) = &self.result {
7497 Some(field as _)
7498 } else {
7499 None
7500 }
7501 }
7502 pub fn error_opt_mut(
7504 &mut self,
7505 ) -> Option<&mut super::super::super::super::google::rpc::Status> {
7506 if let Some(super::get_object_result::Result::Error(field)) = &mut self
7507 .result
7508 {
7509 Some(field as _)
7510 } else {
7511 None
7512 }
7513 }
7514 pub fn error_mut(
7518 &mut self,
7519 ) -> &mut super::super::super::super::google::rpc::Status {
7520 if self.error_opt_mut().is_none() {
7521 self.result = Some(
7522 super::get_object_result::Result::Error(
7523 super::super::super::super::google::rpc::Status::default(),
7524 ),
7525 );
7526 }
7527 self.error_opt_mut().unwrap()
7528 }
7529 pub fn set_error<T: Into<super::super::super::super::google::rpc::Status>>(
7532 &mut self,
7533 field: T,
7534 ) {
7535 self.result = Some(
7536 super::get_object_result::Result::Error(field.into().into()),
7537 );
7538 }
7539 pub fn with_error<T: Into<super::super::super::super::google::rpc::Status>>(
7542 mut self,
7543 field: T,
7544 ) -> Self {
7545 self.set_error(field.into());
7546 self
7547 }
7548 }
7549 impl super::GetPackageRequest {
7550 pub const fn const_default() -> Self {
7551 Self { package_id: None }
7552 }
7553 #[doc(hidden)]
7554 pub fn default_instance() -> &'static Self {
7555 static DEFAULT: super::GetPackageRequest = super::GetPackageRequest::const_default();
7556 &DEFAULT
7557 }
7558 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
7560 self.package_id.as_mut().map(|field| field as _)
7561 }
7562 pub fn package_id_mut(&mut self) -> &mut String {
7565 self.package_id.get_or_insert_default()
7566 }
7567 pub fn package_id_opt(&self) -> Option<&str> {
7569 self.package_id.as_ref().map(|field| field as _)
7570 }
7571 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
7573 self.package_id = Some(field.into().into());
7574 }
7575 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
7577 self.set_package_id(field.into());
7578 self
7579 }
7580 }
7581 impl super::GetPackageResponse {
7582 pub const fn const_default() -> Self {
7583 Self { package: None }
7584 }
7585 #[doc(hidden)]
7586 pub fn default_instance() -> &'static Self {
7587 static DEFAULT: super::GetPackageResponse = super::GetPackageResponse::const_default();
7588 &DEFAULT
7589 }
7590 pub fn package(&self) -> &super::Package {
7592 self.package
7593 .as_ref()
7594 .map(|field| field as _)
7595 .unwrap_or_else(|| super::Package::default_instance() as _)
7596 }
7597 pub fn package_opt_mut(&mut self) -> Option<&mut super::Package> {
7599 self.package.as_mut().map(|field| field as _)
7600 }
7601 pub fn package_mut(&mut self) -> &mut super::Package {
7604 self.package.get_or_insert_default()
7605 }
7606 pub fn package_opt(&self) -> Option<&super::Package> {
7608 self.package.as_ref().map(|field| field as _)
7609 }
7610 pub fn set_package<T: Into<super::Package>>(&mut self, field: T) {
7612 self.package = Some(field.into().into());
7613 }
7614 pub fn with_package<T: Into<super::Package>>(mut self, field: T) -> Self {
7616 self.set_package(field.into());
7617 self
7618 }
7619 }
7620 impl super::GetServiceInfoRequest {
7621 pub const fn const_default() -> Self {
7622 Self {}
7623 }
7624 #[doc(hidden)]
7625 pub fn default_instance() -> &'static Self {
7626 static DEFAULT: super::GetServiceInfoRequest = super::GetServiceInfoRequest::const_default();
7627 &DEFAULT
7628 }
7629 }
7630 impl super::GetServiceInfoResponse {
7631 pub const fn const_default() -> Self {
7632 Self {
7633 chain_id: None,
7634 chain: None,
7635 epoch: None,
7636 checkpoint_height: None,
7637 timestamp: None,
7638 lowest_available_checkpoint: None,
7639 lowest_available_checkpoint_objects: None,
7640 server: None,
7641 }
7642 }
7643 #[doc(hidden)]
7644 pub fn default_instance() -> &'static Self {
7645 static DEFAULT: super::GetServiceInfoResponse = super::GetServiceInfoResponse::const_default();
7646 &DEFAULT
7647 }
7648 pub fn chain_id_opt_mut(&mut self) -> Option<&mut String> {
7650 self.chain_id.as_mut().map(|field| field as _)
7651 }
7652 pub fn chain_id_mut(&mut self) -> &mut String {
7655 self.chain_id.get_or_insert_default()
7656 }
7657 pub fn chain_id_opt(&self) -> Option<&str> {
7659 self.chain_id.as_ref().map(|field| field as _)
7660 }
7661 pub fn set_chain_id<T: Into<String>>(&mut self, field: T) {
7663 self.chain_id = Some(field.into().into());
7664 }
7665 pub fn with_chain_id<T: Into<String>>(mut self, field: T) -> Self {
7667 self.set_chain_id(field.into());
7668 self
7669 }
7670 pub fn chain_opt_mut(&mut self) -> Option<&mut String> {
7672 self.chain.as_mut().map(|field| field as _)
7673 }
7674 pub fn chain_mut(&mut self) -> &mut String {
7677 self.chain.get_or_insert_default()
7678 }
7679 pub fn chain_opt(&self) -> Option<&str> {
7681 self.chain.as_ref().map(|field| field as _)
7682 }
7683 pub fn set_chain<T: Into<String>>(&mut self, field: T) {
7685 self.chain = Some(field.into().into());
7686 }
7687 pub fn with_chain<T: Into<String>>(mut self, field: T) -> Self {
7689 self.set_chain(field.into());
7690 self
7691 }
7692 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
7694 self.epoch.as_mut().map(|field| field as _)
7695 }
7696 pub fn epoch_mut(&mut self) -> &mut u64 {
7699 self.epoch.get_or_insert_default()
7700 }
7701 pub fn epoch_opt(&self) -> Option<u64> {
7703 self.epoch.as_ref().map(|field| *field)
7704 }
7705 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
7707 self.epoch = Some(field.into().into());
7708 }
7709 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
7711 self.set_epoch(field.into());
7712 self
7713 }
7714 pub fn checkpoint_height_opt_mut(&mut self) -> Option<&mut u64> {
7716 self.checkpoint_height.as_mut().map(|field| field as _)
7717 }
7718 pub fn checkpoint_height_mut(&mut self) -> &mut u64 {
7721 self.checkpoint_height.get_or_insert_default()
7722 }
7723 pub fn checkpoint_height_opt(&self) -> Option<u64> {
7725 self.checkpoint_height.as_ref().map(|field| *field)
7726 }
7727 pub fn set_checkpoint_height<T: Into<u64>>(&mut self, field: T) {
7729 self.checkpoint_height = Some(field.into().into());
7730 }
7731 pub fn with_checkpoint_height<T: Into<u64>>(mut self, field: T) -> Self {
7733 self.set_checkpoint_height(field.into());
7734 self
7735 }
7736 pub fn timestamp_opt_mut(&mut self) -> Option<&mut ::prost_types::Timestamp> {
7738 self.timestamp.as_mut().map(|field| field as _)
7739 }
7740 pub fn timestamp_mut(&mut self) -> &mut ::prost_types::Timestamp {
7743 self.timestamp.get_or_insert_default()
7744 }
7745 pub fn timestamp_opt(&self) -> Option<&::prost_types::Timestamp> {
7747 self.timestamp.as_ref().map(|field| field as _)
7748 }
7749 pub fn set_timestamp<T: Into<::prost_types::Timestamp>>(&mut self, field: T) {
7751 self.timestamp = Some(field.into().into());
7752 }
7753 pub fn with_timestamp<T: Into<::prost_types::Timestamp>>(
7755 mut self,
7756 field: T,
7757 ) -> Self {
7758 self.set_timestamp(field.into());
7759 self
7760 }
7761 pub fn lowest_available_checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
7763 self.lowest_available_checkpoint.as_mut().map(|field| field as _)
7764 }
7765 pub fn lowest_available_checkpoint_mut(&mut self) -> &mut u64 {
7768 self.lowest_available_checkpoint.get_or_insert_default()
7769 }
7770 pub fn lowest_available_checkpoint_opt(&self) -> Option<u64> {
7772 self.lowest_available_checkpoint.as_ref().map(|field| *field)
7773 }
7774 pub fn set_lowest_available_checkpoint<T: Into<u64>>(&mut self, field: T) {
7776 self.lowest_available_checkpoint = Some(field.into().into());
7777 }
7778 pub fn with_lowest_available_checkpoint<T: Into<u64>>(
7780 mut self,
7781 field: T,
7782 ) -> Self {
7783 self.set_lowest_available_checkpoint(field.into());
7784 self
7785 }
7786 pub fn lowest_available_checkpoint_objects_opt_mut(
7788 &mut self,
7789 ) -> Option<&mut u64> {
7790 self.lowest_available_checkpoint_objects.as_mut().map(|field| field as _)
7791 }
7792 pub fn lowest_available_checkpoint_objects_mut(&mut self) -> &mut u64 {
7795 self.lowest_available_checkpoint_objects.get_or_insert_default()
7796 }
7797 pub fn lowest_available_checkpoint_objects_opt(&self) -> Option<u64> {
7799 self.lowest_available_checkpoint_objects.as_ref().map(|field| *field)
7800 }
7801 pub fn set_lowest_available_checkpoint_objects<T: Into<u64>>(
7803 &mut self,
7804 field: T,
7805 ) {
7806 self.lowest_available_checkpoint_objects = Some(field.into().into());
7807 }
7808 pub fn with_lowest_available_checkpoint_objects<T: Into<u64>>(
7810 mut self,
7811 field: T,
7812 ) -> Self {
7813 self.set_lowest_available_checkpoint_objects(field.into());
7814 self
7815 }
7816 pub fn server_opt_mut(&mut self) -> Option<&mut String> {
7818 self.server.as_mut().map(|field| field as _)
7819 }
7820 pub fn server_mut(&mut self) -> &mut String {
7823 self.server.get_or_insert_default()
7824 }
7825 pub fn server_opt(&self) -> Option<&str> {
7827 self.server.as_ref().map(|field| field as _)
7828 }
7829 pub fn set_server<T: Into<String>>(&mut self, field: T) {
7831 self.server = Some(field.into().into());
7832 }
7833 pub fn with_server<T: Into<String>>(mut self, field: T) -> Self {
7835 self.set_server(field.into());
7836 self
7837 }
7838 }
7839 impl super::GetTransactionRequest {
7840 pub const fn const_default() -> Self {
7841 Self {
7842 digest: None,
7843 read_mask: None,
7844 }
7845 }
7846 #[doc(hidden)]
7847 pub fn default_instance() -> &'static Self {
7848 static DEFAULT: super::GetTransactionRequest = super::GetTransactionRequest::const_default();
7849 &DEFAULT
7850 }
7851 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
7853 self.digest.as_mut().map(|field| field as _)
7854 }
7855 pub fn digest_mut(&mut self) -> &mut String {
7858 self.digest.get_or_insert_default()
7859 }
7860 pub fn digest_opt(&self) -> Option<&str> {
7862 self.digest.as_ref().map(|field| field as _)
7863 }
7864 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
7866 self.digest = Some(field.into().into());
7867 }
7868 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
7870 self.set_digest(field.into());
7871 self
7872 }
7873 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
7875 self.read_mask.as_mut().map(|field| field as _)
7876 }
7877 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
7880 self.read_mask.get_or_insert_default()
7881 }
7882 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
7884 self.read_mask.as_ref().map(|field| field as _)
7885 }
7886 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
7888 self.read_mask = Some(field.into().into());
7889 }
7890 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
7892 mut self,
7893 field: T,
7894 ) -> Self {
7895 self.set_read_mask(field.into());
7896 self
7897 }
7898 }
7899 impl super::GetTransactionResponse {
7900 pub const fn const_default() -> Self {
7901 Self { transaction: None }
7902 }
7903 #[doc(hidden)]
7904 pub fn default_instance() -> &'static Self {
7905 static DEFAULT: super::GetTransactionResponse = super::GetTransactionResponse::const_default();
7906 &DEFAULT
7907 }
7908 pub fn transaction(&self) -> &super::ExecutedTransaction {
7910 self.transaction
7911 .as_ref()
7912 .map(|field| field as _)
7913 .unwrap_or_else(|| super::ExecutedTransaction::default_instance() as _)
7914 }
7915 pub fn transaction_opt_mut(
7917 &mut self,
7918 ) -> Option<&mut super::ExecutedTransaction> {
7919 self.transaction.as_mut().map(|field| field as _)
7920 }
7921 pub fn transaction_mut(&mut self) -> &mut super::ExecutedTransaction {
7924 self.transaction.get_or_insert_default()
7925 }
7926 pub fn transaction_opt(&self) -> Option<&super::ExecutedTransaction> {
7928 self.transaction.as_ref().map(|field| field as _)
7929 }
7930 pub fn set_transaction<T: Into<super::ExecutedTransaction>>(
7932 &mut self,
7933 field: T,
7934 ) {
7935 self.transaction = Some(field.into().into());
7936 }
7937 pub fn with_transaction<T: Into<super::ExecutedTransaction>>(
7939 mut self,
7940 field: T,
7941 ) -> Self {
7942 self.set_transaction(field.into());
7943 self
7944 }
7945 }
7946 impl super::GetTransactionResult {
7947 pub const fn const_default() -> Self {
7948 Self { result: None }
7949 }
7950 #[doc(hidden)]
7951 pub fn default_instance() -> &'static Self {
7952 static DEFAULT: super::GetTransactionResult = super::GetTransactionResult::const_default();
7953 &DEFAULT
7954 }
7955 pub fn transaction(&self) -> &super::ExecutedTransaction {
7957 if let Some(super::get_transaction_result::Result::Transaction(field)) = &self
7958 .result
7959 {
7960 field as _
7961 } else {
7962 super::ExecutedTransaction::default_instance() as _
7963 }
7964 }
7965 pub fn transaction_opt(&self) -> Option<&super::ExecutedTransaction> {
7967 if let Some(super::get_transaction_result::Result::Transaction(field)) = &self
7968 .result
7969 {
7970 Some(field as _)
7971 } else {
7972 None
7973 }
7974 }
7975 pub fn transaction_opt_mut(
7977 &mut self,
7978 ) -> Option<&mut super::ExecutedTransaction> {
7979 if let Some(super::get_transaction_result::Result::Transaction(field)) = &mut self
7980 .result
7981 {
7982 Some(field as _)
7983 } else {
7984 None
7985 }
7986 }
7987 pub fn transaction_mut(&mut self) -> &mut super::ExecutedTransaction {
7991 if self.transaction_opt_mut().is_none() {
7992 self.result = Some(
7993 super::get_transaction_result::Result::Transaction(
7994 super::ExecutedTransaction::default(),
7995 ),
7996 );
7997 }
7998 self.transaction_opt_mut().unwrap()
7999 }
8000 pub fn set_transaction<T: Into<super::ExecutedTransaction>>(
8003 &mut self,
8004 field: T,
8005 ) {
8006 self.result = Some(
8007 super::get_transaction_result::Result::Transaction(field.into().into()),
8008 );
8009 }
8010 pub fn with_transaction<T: Into<super::ExecutedTransaction>>(
8013 mut self,
8014 field: T,
8015 ) -> Self {
8016 self.set_transaction(field.into());
8017 self
8018 }
8019 pub fn error(&self) -> &super::super::super::super::google::rpc::Status {
8021 if let Some(super::get_transaction_result::Result::Error(field)) = &self
8022 .result
8023 {
8024 field as _
8025 } else {
8026 super::super::super::super::google::rpc::Status::default_instance() as _
8027 }
8028 }
8029 pub fn error_opt(
8031 &self,
8032 ) -> Option<&super::super::super::super::google::rpc::Status> {
8033 if let Some(super::get_transaction_result::Result::Error(field)) = &self
8034 .result
8035 {
8036 Some(field as _)
8037 } else {
8038 None
8039 }
8040 }
8041 pub fn error_opt_mut(
8043 &mut self,
8044 ) -> Option<&mut super::super::super::super::google::rpc::Status> {
8045 if let Some(super::get_transaction_result::Result::Error(field)) = &mut self
8046 .result
8047 {
8048 Some(field as _)
8049 } else {
8050 None
8051 }
8052 }
8053 pub fn error_mut(
8057 &mut self,
8058 ) -> &mut super::super::super::super::google::rpc::Status {
8059 if self.error_opt_mut().is_none() {
8060 self.result = Some(
8061 super::get_transaction_result::Result::Error(
8062 super::super::super::super::google::rpc::Status::default(),
8063 ),
8064 );
8065 }
8066 self.error_opt_mut().unwrap()
8067 }
8068 pub fn set_error<T: Into<super::super::super::super::google::rpc::Status>>(
8071 &mut self,
8072 field: T,
8073 ) {
8074 self.result = Some(
8075 super::get_transaction_result::Result::Error(field.into().into()),
8076 );
8077 }
8078 pub fn with_error<T: Into<super::super::super::super::google::rpc::Status>>(
8081 mut self,
8082 field: T,
8083 ) -> Self {
8084 self.set_error(field.into());
8085 self
8086 }
8087 }
8088 impl super::IndexError {
8089 pub const fn const_default() -> Self {
8090 Self {
8091 index: None,
8092 subresult: None,
8093 }
8094 }
8095 #[doc(hidden)]
8096 pub fn default_instance() -> &'static Self {
8097 static DEFAULT: super::IndexError = super::IndexError::const_default();
8098 &DEFAULT
8099 }
8100 pub fn index_opt_mut(&mut self) -> Option<&mut u32> {
8102 self.index.as_mut().map(|field| field as _)
8103 }
8104 pub fn index_mut(&mut self) -> &mut u32 {
8107 self.index.get_or_insert_default()
8108 }
8109 pub fn index_opt(&self) -> Option<u32> {
8111 self.index.as_ref().map(|field| *field)
8112 }
8113 pub fn set_index<T: Into<u32>>(&mut self, field: T) {
8115 self.index = Some(field.into().into());
8116 }
8117 pub fn with_index<T: Into<u32>>(mut self, field: T) -> Self {
8119 self.set_index(field.into());
8120 self
8121 }
8122 pub fn subresult_opt_mut(&mut self) -> Option<&mut u32> {
8124 self.subresult.as_mut().map(|field| field as _)
8125 }
8126 pub fn subresult_mut(&mut self) -> &mut u32 {
8129 self.subresult.get_or_insert_default()
8130 }
8131 pub fn subresult_opt(&self) -> Option<u32> {
8133 self.subresult.as_ref().map(|field| *field)
8134 }
8135 pub fn set_subresult<T: Into<u32>>(&mut self, field: T) {
8137 self.subresult = Some(field.into().into());
8138 }
8139 pub fn with_subresult<T: Into<u32>>(mut self, field: T) -> Self {
8141 self.set_subresult(field.into());
8142 self
8143 }
8144 }
8145 impl super::Input {
8146 pub const fn const_default() -> Self {
8147 Self {
8148 kind: None,
8149 pure: None,
8150 object_id: None,
8151 version: None,
8152 digest: None,
8153 mutable: None,
8154 literal: None,
8155 }
8156 }
8157 #[doc(hidden)]
8158 pub fn default_instance() -> &'static Self {
8159 static DEFAULT: super::Input = super::Input::const_default();
8160 &DEFAULT
8161 }
8162 pub fn with_kind<T: Into<super::input::InputKind>>(mut self, field: T) -> Self {
8164 self.set_kind(field.into());
8165 self
8166 }
8167 pub fn pure_opt(&self) -> Option<&[u8]> {
8169 self.pure.as_ref().map(|field| field as _)
8170 }
8171 pub fn set_pure<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8173 self.pure = Some(field.into().into());
8174 }
8175 pub fn with_pure<T: Into<::prost::bytes::Bytes>>(mut self, field: T) -> Self {
8177 self.set_pure(field.into());
8178 self
8179 }
8180 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
8182 self.object_id.as_mut().map(|field| field as _)
8183 }
8184 pub fn object_id_mut(&mut self) -> &mut String {
8187 self.object_id.get_or_insert_default()
8188 }
8189 pub fn object_id_opt(&self) -> Option<&str> {
8191 self.object_id.as_ref().map(|field| field as _)
8192 }
8193 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
8195 self.object_id = Some(field.into().into());
8196 }
8197 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
8199 self.set_object_id(field.into());
8200 self
8201 }
8202 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
8204 self.version.as_mut().map(|field| field as _)
8205 }
8206 pub fn version_mut(&mut self) -> &mut u64 {
8209 self.version.get_or_insert_default()
8210 }
8211 pub fn version_opt(&self) -> Option<u64> {
8213 self.version.as_ref().map(|field| *field)
8214 }
8215 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
8217 self.version = Some(field.into().into());
8218 }
8219 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
8221 self.set_version(field.into());
8222 self
8223 }
8224 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
8226 self.digest.as_mut().map(|field| field as _)
8227 }
8228 pub fn digest_mut(&mut self) -> &mut String {
8231 self.digest.get_or_insert_default()
8232 }
8233 pub fn digest_opt(&self) -> Option<&str> {
8235 self.digest.as_ref().map(|field| field as _)
8236 }
8237 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
8239 self.digest = Some(field.into().into());
8240 }
8241 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
8243 self.set_digest(field.into());
8244 self
8245 }
8246 pub fn mutable_opt_mut(&mut self) -> Option<&mut bool> {
8248 self.mutable.as_mut().map(|field| field as _)
8249 }
8250 pub fn mutable_mut(&mut self) -> &mut bool {
8253 self.mutable.get_or_insert_default()
8254 }
8255 pub fn mutable_opt(&self) -> Option<bool> {
8257 self.mutable.as_ref().map(|field| *field)
8258 }
8259 pub fn set_mutable<T: Into<bool>>(&mut self, field: T) {
8261 self.mutable = Some(field.into().into());
8262 }
8263 pub fn with_mutable<T: Into<bool>>(mut self, field: T) -> Self {
8265 self.set_mutable(field.into());
8266 self
8267 }
8268 pub fn literal_opt_mut(&mut self) -> Option<&mut ::prost_types::Value> {
8270 self.literal.as_mut().map(|field| field as _)
8271 }
8272 pub fn literal_mut(&mut self) -> &mut ::prost_types::Value {
8275 self.literal.get_or_insert_default()
8276 }
8277 pub fn literal_opt(&self) -> Option<&::prost_types::Value> {
8279 self.literal.as_ref().map(|field| field as _)
8280 }
8281 pub fn set_literal<T: Into<::prost_types::Value>>(&mut self, field: T) {
8283 self.literal = Some(field.into().into());
8284 }
8285 pub fn with_literal<T: Into<::prost_types::Value>>(mut self, field: T) -> Self {
8287 self.set_literal(field.into());
8288 self
8289 }
8290 }
8291 impl super::Jwk {
8292 pub const fn const_default() -> Self {
8293 Self {
8294 kty: None,
8295 e: None,
8296 n: None,
8297 alg: None,
8298 }
8299 }
8300 #[doc(hidden)]
8301 pub fn default_instance() -> &'static Self {
8302 static DEFAULT: super::Jwk = super::Jwk::const_default();
8303 &DEFAULT
8304 }
8305 pub fn kty_opt_mut(&mut self) -> Option<&mut String> {
8307 self.kty.as_mut().map(|field| field as _)
8308 }
8309 pub fn kty_mut(&mut self) -> &mut String {
8312 self.kty.get_or_insert_default()
8313 }
8314 pub fn kty_opt(&self) -> Option<&str> {
8316 self.kty.as_ref().map(|field| field as _)
8317 }
8318 pub fn set_kty<T: Into<String>>(&mut self, field: T) {
8320 self.kty = Some(field.into().into());
8321 }
8322 pub fn with_kty<T: Into<String>>(mut self, field: T) -> Self {
8324 self.set_kty(field.into());
8325 self
8326 }
8327 pub fn e_opt_mut(&mut self) -> Option<&mut String> {
8329 self.e.as_mut().map(|field| field as _)
8330 }
8331 pub fn e_mut(&mut self) -> &mut String {
8334 self.e.get_or_insert_default()
8335 }
8336 pub fn e_opt(&self) -> Option<&str> {
8338 self.e.as_ref().map(|field| field as _)
8339 }
8340 pub fn set_e<T: Into<String>>(&mut self, field: T) {
8342 self.e = Some(field.into().into());
8343 }
8344 pub fn with_e<T: Into<String>>(mut self, field: T) -> Self {
8346 self.set_e(field.into());
8347 self
8348 }
8349 pub fn n_opt_mut(&mut self) -> Option<&mut String> {
8351 self.n.as_mut().map(|field| field as _)
8352 }
8353 pub fn n_mut(&mut self) -> &mut String {
8356 self.n.get_or_insert_default()
8357 }
8358 pub fn n_opt(&self) -> Option<&str> {
8360 self.n.as_ref().map(|field| field as _)
8361 }
8362 pub fn set_n<T: Into<String>>(&mut self, field: T) {
8364 self.n = Some(field.into().into());
8365 }
8366 pub fn with_n<T: Into<String>>(mut self, field: T) -> Self {
8368 self.set_n(field.into());
8369 self
8370 }
8371 pub fn alg_opt_mut(&mut self) -> Option<&mut String> {
8373 self.alg.as_mut().map(|field| field as _)
8374 }
8375 pub fn alg_mut(&mut self) -> &mut String {
8378 self.alg.get_or_insert_default()
8379 }
8380 pub fn alg_opt(&self) -> Option<&str> {
8382 self.alg.as_ref().map(|field| field as _)
8383 }
8384 pub fn set_alg<T: Into<String>>(&mut self, field: T) {
8386 self.alg = Some(field.into().into());
8387 }
8388 pub fn with_alg<T: Into<String>>(mut self, field: T) -> Self {
8390 self.set_alg(field.into());
8391 self
8392 }
8393 }
8394 impl super::JwkId {
8395 pub const fn const_default() -> Self {
8396 Self { iss: None, kid: None }
8397 }
8398 #[doc(hidden)]
8399 pub fn default_instance() -> &'static Self {
8400 static DEFAULT: super::JwkId = super::JwkId::const_default();
8401 &DEFAULT
8402 }
8403 pub fn iss_opt_mut(&mut self) -> Option<&mut String> {
8405 self.iss.as_mut().map(|field| field as _)
8406 }
8407 pub fn iss_mut(&mut self) -> &mut String {
8410 self.iss.get_or_insert_default()
8411 }
8412 pub fn iss_opt(&self) -> Option<&str> {
8414 self.iss.as_ref().map(|field| field as _)
8415 }
8416 pub fn set_iss<T: Into<String>>(&mut self, field: T) {
8418 self.iss = Some(field.into().into());
8419 }
8420 pub fn with_iss<T: Into<String>>(mut self, field: T) -> Self {
8422 self.set_iss(field.into());
8423 self
8424 }
8425 pub fn kid_opt_mut(&mut self) -> Option<&mut String> {
8427 self.kid.as_mut().map(|field| field as _)
8428 }
8429 pub fn kid_mut(&mut self) -> &mut String {
8432 self.kid.get_or_insert_default()
8433 }
8434 pub fn kid_opt(&self) -> Option<&str> {
8436 self.kid.as_ref().map(|field| field as _)
8437 }
8438 pub fn set_kid<T: Into<String>>(&mut self, field: T) {
8440 self.kid = Some(field.into().into());
8441 }
8442 pub fn with_kid<T: Into<String>>(mut self, field: T) -> Self {
8444 self.set_kid(field.into());
8445 self
8446 }
8447 }
8448 impl super::Linkage {
8449 pub const fn const_default() -> Self {
8450 Self {
8451 original_id: None,
8452 upgraded_id: None,
8453 upgraded_version: None,
8454 }
8455 }
8456 #[doc(hidden)]
8457 pub fn default_instance() -> &'static Self {
8458 static DEFAULT: super::Linkage = super::Linkage::const_default();
8459 &DEFAULT
8460 }
8461 pub fn original_id_opt_mut(&mut self) -> Option<&mut String> {
8463 self.original_id.as_mut().map(|field| field as _)
8464 }
8465 pub fn original_id_mut(&mut self) -> &mut String {
8468 self.original_id.get_or_insert_default()
8469 }
8470 pub fn original_id_opt(&self) -> Option<&str> {
8472 self.original_id.as_ref().map(|field| field as _)
8473 }
8474 pub fn set_original_id<T: Into<String>>(&mut self, field: T) {
8476 self.original_id = Some(field.into().into());
8477 }
8478 pub fn with_original_id<T: Into<String>>(mut self, field: T) -> Self {
8480 self.set_original_id(field.into());
8481 self
8482 }
8483 pub fn upgraded_id_opt_mut(&mut self) -> Option<&mut String> {
8485 self.upgraded_id.as_mut().map(|field| field as _)
8486 }
8487 pub fn upgraded_id_mut(&mut self) -> &mut String {
8490 self.upgraded_id.get_or_insert_default()
8491 }
8492 pub fn upgraded_id_opt(&self) -> Option<&str> {
8494 self.upgraded_id.as_ref().map(|field| field as _)
8495 }
8496 pub fn set_upgraded_id<T: Into<String>>(&mut self, field: T) {
8498 self.upgraded_id = Some(field.into().into());
8499 }
8500 pub fn with_upgraded_id<T: Into<String>>(mut self, field: T) -> Self {
8502 self.set_upgraded_id(field.into());
8503 self
8504 }
8505 pub fn upgraded_version_opt_mut(&mut self) -> Option<&mut u64> {
8507 self.upgraded_version.as_mut().map(|field| field as _)
8508 }
8509 pub fn upgraded_version_mut(&mut self) -> &mut u64 {
8512 self.upgraded_version.get_or_insert_default()
8513 }
8514 pub fn upgraded_version_opt(&self) -> Option<u64> {
8516 self.upgraded_version.as_ref().map(|field| *field)
8517 }
8518 pub fn set_upgraded_version<T: Into<u64>>(&mut self, field: T) {
8520 self.upgraded_version = Some(field.into().into());
8521 }
8522 pub fn with_upgraded_version<T: Into<u64>>(mut self, field: T) -> Self {
8524 self.set_upgraded_version(field.into());
8525 self
8526 }
8527 }
8528 impl super::ListBalancesRequest {
8529 pub const fn const_default() -> Self {
8530 Self {
8531 owner: None,
8532 page_size: None,
8533 page_token: None,
8534 }
8535 }
8536 #[doc(hidden)]
8537 pub fn default_instance() -> &'static Self {
8538 static DEFAULT: super::ListBalancesRequest = super::ListBalancesRequest::const_default();
8539 &DEFAULT
8540 }
8541 pub fn owner_opt_mut(&mut self) -> Option<&mut String> {
8543 self.owner.as_mut().map(|field| field as _)
8544 }
8545 pub fn owner_mut(&mut self) -> &mut String {
8548 self.owner.get_or_insert_default()
8549 }
8550 pub fn owner_opt(&self) -> Option<&str> {
8552 self.owner.as_ref().map(|field| field as _)
8553 }
8554 pub fn set_owner<T: Into<String>>(&mut self, field: T) {
8556 self.owner = Some(field.into().into());
8557 }
8558 pub fn with_owner<T: Into<String>>(mut self, field: T) -> Self {
8560 self.set_owner(field.into());
8561 self
8562 }
8563 pub fn page_size_opt_mut(&mut self) -> Option<&mut u32> {
8565 self.page_size.as_mut().map(|field| field as _)
8566 }
8567 pub fn page_size_mut(&mut self) -> &mut u32 {
8570 self.page_size.get_or_insert_default()
8571 }
8572 pub fn page_size_opt(&self) -> Option<u32> {
8574 self.page_size.as_ref().map(|field| *field)
8575 }
8576 pub fn set_page_size<T: Into<u32>>(&mut self, field: T) {
8578 self.page_size = Some(field.into().into());
8579 }
8580 pub fn with_page_size<T: Into<u32>>(mut self, field: T) -> Self {
8582 self.set_page_size(field.into());
8583 self
8584 }
8585 pub fn page_token_opt(&self) -> Option<&[u8]> {
8587 self.page_token.as_ref().map(|field| field as _)
8588 }
8589 pub fn set_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8591 self.page_token = Some(field.into().into());
8592 }
8593 pub fn with_page_token<T: Into<::prost::bytes::Bytes>>(
8595 mut self,
8596 field: T,
8597 ) -> Self {
8598 self.set_page_token(field.into());
8599 self
8600 }
8601 }
8602 impl super::ListBalancesResponse {
8603 pub const fn const_default() -> Self {
8604 Self {
8605 balances: Vec::new(),
8606 next_page_token: None,
8607 }
8608 }
8609 #[doc(hidden)]
8610 pub fn default_instance() -> &'static Self {
8611 static DEFAULT: super::ListBalancesResponse = super::ListBalancesResponse::const_default();
8612 &DEFAULT
8613 }
8614 pub fn balances(&self) -> &[super::Balance] {
8616 &self.balances
8617 }
8618 pub fn balances_mut(&mut self) -> &mut Vec<super::Balance> {
8621 &mut self.balances
8622 }
8623 pub fn set_balances(&mut self, field: Vec<super::Balance>) {
8625 self.balances = field;
8626 }
8627 pub fn with_balances(mut self, field: Vec<super::Balance>) -> Self {
8629 self.set_balances(field);
8630 self
8631 }
8632 pub fn next_page_token_opt(&self) -> Option<&[u8]> {
8634 self.next_page_token.as_ref().map(|field| field as _)
8635 }
8636 pub fn set_next_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8638 self.next_page_token = Some(field.into().into());
8639 }
8640 pub fn with_next_page_token<T: Into<::prost::bytes::Bytes>>(
8642 mut self,
8643 field: T,
8644 ) -> Self {
8645 self.set_next_page_token(field.into());
8646 self
8647 }
8648 }
8649 impl super::ListDynamicFieldsRequest {
8650 pub const fn const_default() -> Self {
8651 Self {
8652 parent: None,
8653 page_size: None,
8654 page_token: None,
8655 read_mask: None,
8656 }
8657 }
8658 #[doc(hidden)]
8659 pub fn default_instance() -> &'static Self {
8660 static DEFAULT: super::ListDynamicFieldsRequest = super::ListDynamicFieldsRequest::const_default();
8661 &DEFAULT
8662 }
8663 pub fn parent_opt_mut(&mut self) -> Option<&mut String> {
8665 self.parent.as_mut().map(|field| field as _)
8666 }
8667 pub fn parent_mut(&mut self) -> &mut String {
8670 self.parent.get_or_insert_default()
8671 }
8672 pub fn parent_opt(&self) -> Option<&str> {
8674 self.parent.as_ref().map(|field| field as _)
8675 }
8676 pub fn set_parent<T: Into<String>>(&mut self, field: T) {
8678 self.parent = Some(field.into().into());
8679 }
8680 pub fn with_parent<T: Into<String>>(mut self, field: T) -> Self {
8682 self.set_parent(field.into());
8683 self
8684 }
8685 pub fn page_size_opt_mut(&mut self) -> Option<&mut u32> {
8687 self.page_size.as_mut().map(|field| field as _)
8688 }
8689 pub fn page_size_mut(&mut self) -> &mut u32 {
8692 self.page_size.get_or_insert_default()
8693 }
8694 pub fn page_size_opt(&self) -> Option<u32> {
8696 self.page_size.as_ref().map(|field| *field)
8697 }
8698 pub fn set_page_size<T: Into<u32>>(&mut self, field: T) {
8700 self.page_size = Some(field.into().into());
8701 }
8702 pub fn with_page_size<T: Into<u32>>(mut self, field: T) -> Self {
8704 self.set_page_size(field.into());
8705 self
8706 }
8707 pub fn page_token_opt(&self) -> Option<&[u8]> {
8709 self.page_token.as_ref().map(|field| field as _)
8710 }
8711 pub fn set_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8713 self.page_token = Some(field.into().into());
8714 }
8715 pub fn with_page_token<T: Into<::prost::bytes::Bytes>>(
8717 mut self,
8718 field: T,
8719 ) -> Self {
8720 self.set_page_token(field.into());
8721 self
8722 }
8723 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
8725 self.read_mask.as_mut().map(|field| field as _)
8726 }
8727 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
8730 self.read_mask.get_or_insert_default()
8731 }
8732 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
8734 self.read_mask.as_ref().map(|field| field as _)
8735 }
8736 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
8738 self.read_mask = Some(field.into().into());
8739 }
8740 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
8742 mut self,
8743 field: T,
8744 ) -> Self {
8745 self.set_read_mask(field.into());
8746 self
8747 }
8748 }
8749 impl super::ListDynamicFieldsResponse {
8750 pub const fn const_default() -> Self {
8751 Self {
8752 dynamic_fields: Vec::new(),
8753 next_page_token: None,
8754 }
8755 }
8756 #[doc(hidden)]
8757 pub fn default_instance() -> &'static Self {
8758 static DEFAULT: super::ListDynamicFieldsResponse = super::ListDynamicFieldsResponse::const_default();
8759 &DEFAULT
8760 }
8761 pub fn dynamic_fields(&self) -> &[super::DynamicField] {
8763 &self.dynamic_fields
8764 }
8765 pub fn dynamic_fields_mut(&mut self) -> &mut Vec<super::DynamicField> {
8768 &mut self.dynamic_fields
8769 }
8770 pub fn set_dynamic_fields(&mut self, field: Vec<super::DynamicField>) {
8772 self.dynamic_fields = field;
8773 }
8774 pub fn with_dynamic_fields(mut self, field: Vec<super::DynamicField>) -> Self {
8776 self.set_dynamic_fields(field);
8777 self
8778 }
8779 pub fn next_page_token_opt(&self) -> Option<&[u8]> {
8781 self.next_page_token.as_ref().map(|field| field as _)
8782 }
8783 pub fn set_next_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8785 self.next_page_token = Some(field.into().into());
8786 }
8787 pub fn with_next_page_token<T: Into<::prost::bytes::Bytes>>(
8789 mut self,
8790 field: T,
8791 ) -> Self {
8792 self.set_next_page_token(field.into());
8793 self
8794 }
8795 }
8796 impl super::ListOwnedObjectsRequest {
8797 pub const fn const_default() -> Self {
8798 Self {
8799 owner: None,
8800 page_size: None,
8801 page_token: None,
8802 read_mask: None,
8803 object_type: None,
8804 }
8805 }
8806 #[doc(hidden)]
8807 pub fn default_instance() -> &'static Self {
8808 static DEFAULT: super::ListOwnedObjectsRequest = super::ListOwnedObjectsRequest::const_default();
8809 &DEFAULT
8810 }
8811 pub fn owner_opt_mut(&mut self) -> Option<&mut String> {
8813 self.owner.as_mut().map(|field| field as _)
8814 }
8815 pub fn owner_mut(&mut self) -> &mut String {
8818 self.owner.get_or_insert_default()
8819 }
8820 pub fn owner_opt(&self) -> Option<&str> {
8822 self.owner.as_ref().map(|field| field as _)
8823 }
8824 pub fn set_owner<T: Into<String>>(&mut self, field: T) {
8826 self.owner = Some(field.into().into());
8827 }
8828 pub fn with_owner<T: Into<String>>(mut self, field: T) -> Self {
8830 self.set_owner(field.into());
8831 self
8832 }
8833 pub fn page_size_opt_mut(&mut self) -> Option<&mut u32> {
8835 self.page_size.as_mut().map(|field| field as _)
8836 }
8837 pub fn page_size_mut(&mut self) -> &mut u32 {
8840 self.page_size.get_or_insert_default()
8841 }
8842 pub fn page_size_opt(&self) -> Option<u32> {
8844 self.page_size.as_ref().map(|field| *field)
8845 }
8846 pub fn set_page_size<T: Into<u32>>(&mut self, field: T) {
8848 self.page_size = Some(field.into().into());
8849 }
8850 pub fn with_page_size<T: Into<u32>>(mut self, field: T) -> Self {
8852 self.set_page_size(field.into());
8853 self
8854 }
8855 pub fn page_token_opt(&self) -> Option<&[u8]> {
8857 self.page_token.as_ref().map(|field| field as _)
8858 }
8859 pub fn set_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8861 self.page_token = Some(field.into().into());
8862 }
8863 pub fn with_page_token<T: Into<::prost::bytes::Bytes>>(
8865 mut self,
8866 field: T,
8867 ) -> Self {
8868 self.set_page_token(field.into());
8869 self
8870 }
8871 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
8873 self.read_mask.as_mut().map(|field| field as _)
8874 }
8875 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
8878 self.read_mask.get_or_insert_default()
8879 }
8880 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
8882 self.read_mask.as_ref().map(|field| field as _)
8883 }
8884 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
8886 self.read_mask = Some(field.into().into());
8887 }
8888 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
8890 mut self,
8891 field: T,
8892 ) -> Self {
8893 self.set_read_mask(field.into());
8894 self
8895 }
8896 pub fn object_type_opt_mut(&mut self) -> Option<&mut String> {
8898 self.object_type.as_mut().map(|field| field as _)
8899 }
8900 pub fn object_type_mut(&mut self) -> &mut String {
8903 self.object_type.get_or_insert_default()
8904 }
8905 pub fn object_type_opt(&self) -> Option<&str> {
8907 self.object_type.as_ref().map(|field| field as _)
8908 }
8909 pub fn set_object_type<T: Into<String>>(&mut self, field: T) {
8911 self.object_type = Some(field.into().into());
8912 }
8913 pub fn with_object_type<T: Into<String>>(mut self, field: T) -> Self {
8915 self.set_object_type(field.into());
8916 self
8917 }
8918 }
8919 impl super::ListOwnedObjectsResponse {
8920 pub const fn const_default() -> Self {
8921 Self {
8922 objects: Vec::new(),
8923 next_page_token: None,
8924 }
8925 }
8926 #[doc(hidden)]
8927 pub fn default_instance() -> &'static Self {
8928 static DEFAULT: super::ListOwnedObjectsResponse = super::ListOwnedObjectsResponse::const_default();
8929 &DEFAULT
8930 }
8931 pub fn objects(&self) -> &[super::Object] {
8933 &self.objects
8934 }
8935 pub fn objects_mut(&mut self) -> &mut Vec<super::Object> {
8938 &mut self.objects
8939 }
8940 pub fn set_objects(&mut self, field: Vec<super::Object>) {
8942 self.objects = field;
8943 }
8944 pub fn with_objects(mut self, field: Vec<super::Object>) -> Self {
8946 self.set_objects(field);
8947 self
8948 }
8949 pub fn next_page_token_opt(&self) -> Option<&[u8]> {
8951 self.next_page_token.as_ref().map(|field| field as _)
8952 }
8953 pub fn set_next_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
8955 self.next_page_token = Some(field.into().into());
8956 }
8957 pub fn with_next_page_token<T: Into<::prost::bytes::Bytes>>(
8959 mut self,
8960 field: T,
8961 ) -> Self {
8962 self.set_next_page_token(field.into());
8963 self
8964 }
8965 }
8966 impl super::ListPackageVersionsRequest {
8967 pub const fn const_default() -> Self {
8968 Self {
8969 package_id: None,
8970 page_size: None,
8971 page_token: None,
8972 }
8973 }
8974 #[doc(hidden)]
8975 pub fn default_instance() -> &'static Self {
8976 static DEFAULT: super::ListPackageVersionsRequest = super::ListPackageVersionsRequest::const_default();
8977 &DEFAULT
8978 }
8979 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
8981 self.package_id.as_mut().map(|field| field as _)
8982 }
8983 pub fn package_id_mut(&mut self) -> &mut String {
8986 self.package_id.get_or_insert_default()
8987 }
8988 pub fn package_id_opt(&self) -> Option<&str> {
8990 self.package_id.as_ref().map(|field| field as _)
8991 }
8992 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
8994 self.package_id = Some(field.into().into());
8995 }
8996 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
8998 self.set_package_id(field.into());
8999 self
9000 }
9001 pub fn page_size_opt_mut(&mut self) -> Option<&mut u32> {
9003 self.page_size.as_mut().map(|field| field as _)
9004 }
9005 pub fn page_size_mut(&mut self) -> &mut u32 {
9008 self.page_size.get_or_insert_default()
9009 }
9010 pub fn page_size_opt(&self) -> Option<u32> {
9012 self.page_size.as_ref().map(|field| *field)
9013 }
9014 pub fn set_page_size<T: Into<u32>>(&mut self, field: T) {
9016 self.page_size = Some(field.into().into());
9017 }
9018 pub fn with_page_size<T: Into<u32>>(mut self, field: T) -> Self {
9020 self.set_page_size(field.into());
9021 self
9022 }
9023 pub fn page_token_opt(&self) -> Option<&[u8]> {
9025 self.page_token.as_ref().map(|field| field as _)
9026 }
9027 pub fn set_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
9029 self.page_token = Some(field.into().into());
9030 }
9031 pub fn with_page_token<T: Into<::prost::bytes::Bytes>>(
9033 mut self,
9034 field: T,
9035 ) -> Self {
9036 self.set_page_token(field.into());
9037 self
9038 }
9039 }
9040 impl super::ListPackageVersionsResponse {
9041 pub const fn const_default() -> Self {
9042 Self {
9043 versions: Vec::new(),
9044 next_page_token: None,
9045 }
9046 }
9047 #[doc(hidden)]
9048 pub fn default_instance() -> &'static Self {
9049 static DEFAULT: super::ListPackageVersionsResponse = super::ListPackageVersionsResponse::const_default();
9050 &DEFAULT
9051 }
9052 pub fn versions(&self) -> &[super::PackageVersion] {
9054 &self.versions
9055 }
9056 pub fn versions_mut(&mut self) -> &mut Vec<super::PackageVersion> {
9059 &mut self.versions
9060 }
9061 pub fn set_versions(&mut self, field: Vec<super::PackageVersion>) {
9063 self.versions = field;
9064 }
9065 pub fn with_versions(mut self, field: Vec<super::PackageVersion>) -> Self {
9067 self.set_versions(field);
9068 self
9069 }
9070 pub fn next_page_token_opt(&self) -> Option<&[u8]> {
9072 self.next_page_token.as_ref().map(|field| field as _)
9073 }
9074 pub fn set_next_page_token<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
9076 self.next_page_token = Some(field.into().into());
9077 }
9078 pub fn with_next_page_token<T: Into<::prost::bytes::Bytes>>(
9080 mut self,
9081 field: T,
9082 ) -> Self {
9083 self.set_next_page_token(field.into());
9084 self
9085 }
9086 }
9087 impl super::LookupNameRequest {
9088 pub const fn const_default() -> Self {
9089 Self { name: None }
9090 }
9091 #[doc(hidden)]
9092 pub fn default_instance() -> &'static Self {
9093 static DEFAULT: super::LookupNameRequest = super::LookupNameRequest::const_default();
9094 &DEFAULT
9095 }
9096 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
9098 self.name.as_mut().map(|field| field as _)
9099 }
9100 pub fn name_mut(&mut self) -> &mut String {
9103 self.name.get_or_insert_default()
9104 }
9105 pub fn name_opt(&self) -> Option<&str> {
9107 self.name.as_ref().map(|field| field as _)
9108 }
9109 pub fn set_name<T: Into<String>>(&mut self, field: T) {
9111 self.name = Some(field.into().into());
9112 }
9113 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
9115 self.set_name(field.into());
9116 self
9117 }
9118 }
9119 impl super::LookupNameResponse {
9120 pub const fn const_default() -> Self {
9121 Self { record: None }
9122 }
9123 #[doc(hidden)]
9124 pub fn default_instance() -> &'static Self {
9125 static DEFAULT: super::LookupNameResponse = super::LookupNameResponse::const_default();
9126 &DEFAULT
9127 }
9128 pub fn record(&self) -> &super::NameRecord {
9130 self.record
9131 .as_ref()
9132 .map(|field| field as _)
9133 .unwrap_or_else(|| super::NameRecord::default_instance() as _)
9134 }
9135 pub fn record_opt_mut(&mut self) -> Option<&mut super::NameRecord> {
9137 self.record.as_mut().map(|field| field as _)
9138 }
9139 pub fn record_mut(&mut self) -> &mut super::NameRecord {
9142 self.record.get_or_insert_default()
9143 }
9144 pub fn record_opt(&self) -> Option<&super::NameRecord> {
9146 self.record.as_ref().map(|field| field as _)
9147 }
9148 pub fn set_record<T: Into<super::NameRecord>>(&mut self, field: T) {
9150 self.record = Some(field.into().into());
9151 }
9152 pub fn with_record<T: Into<super::NameRecord>>(mut self, field: T) -> Self {
9154 self.set_record(field.into());
9155 self
9156 }
9157 }
9158 impl super::MakeMoveVector {
9159 pub const fn const_default() -> Self {
9160 Self {
9161 element_type: None,
9162 elements: Vec::new(),
9163 }
9164 }
9165 #[doc(hidden)]
9166 pub fn default_instance() -> &'static Self {
9167 static DEFAULT: super::MakeMoveVector = super::MakeMoveVector::const_default();
9168 &DEFAULT
9169 }
9170 pub fn element_type_opt_mut(&mut self) -> Option<&mut String> {
9172 self.element_type.as_mut().map(|field| field as _)
9173 }
9174 pub fn element_type_mut(&mut self) -> &mut String {
9177 self.element_type.get_or_insert_default()
9178 }
9179 pub fn element_type_opt(&self) -> Option<&str> {
9181 self.element_type.as_ref().map(|field| field as _)
9182 }
9183 pub fn set_element_type<T: Into<String>>(&mut self, field: T) {
9185 self.element_type = Some(field.into().into());
9186 }
9187 pub fn with_element_type<T: Into<String>>(mut self, field: T) -> Self {
9189 self.set_element_type(field.into());
9190 self
9191 }
9192 pub fn elements(&self) -> &[super::Argument] {
9194 &self.elements
9195 }
9196 pub fn elements_mut(&mut self) -> &mut Vec<super::Argument> {
9199 &mut self.elements
9200 }
9201 pub fn set_elements(&mut self, field: Vec<super::Argument>) {
9203 self.elements = field;
9204 }
9205 pub fn with_elements(mut self, field: Vec<super::Argument>) -> Self {
9207 self.set_elements(field);
9208 self
9209 }
9210 }
9211 impl super::MergeCoins {
9212 pub const fn const_default() -> Self {
9213 Self {
9214 coin: None,
9215 coins_to_merge: Vec::new(),
9216 }
9217 }
9218 #[doc(hidden)]
9219 pub fn default_instance() -> &'static Self {
9220 static DEFAULT: super::MergeCoins = super::MergeCoins::const_default();
9221 &DEFAULT
9222 }
9223 pub fn coin(&self) -> &super::Argument {
9225 self.coin
9226 .as_ref()
9227 .map(|field| field as _)
9228 .unwrap_or_else(|| super::Argument::default_instance() as _)
9229 }
9230 pub fn coin_opt_mut(&mut self) -> Option<&mut super::Argument> {
9232 self.coin.as_mut().map(|field| field as _)
9233 }
9234 pub fn coin_mut(&mut self) -> &mut super::Argument {
9237 self.coin.get_or_insert_default()
9238 }
9239 pub fn coin_opt(&self) -> Option<&super::Argument> {
9241 self.coin.as_ref().map(|field| field as _)
9242 }
9243 pub fn set_coin<T: Into<super::Argument>>(&mut self, field: T) {
9245 self.coin = Some(field.into().into());
9246 }
9247 pub fn with_coin<T: Into<super::Argument>>(mut self, field: T) -> Self {
9249 self.set_coin(field.into());
9250 self
9251 }
9252 pub fn coins_to_merge(&self) -> &[super::Argument] {
9254 &self.coins_to_merge
9255 }
9256 pub fn coins_to_merge_mut(&mut self) -> &mut Vec<super::Argument> {
9259 &mut self.coins_to_merge
9260 }
9261 pub fn set_coins_to_merge(&mut self, field: Vec<super::Argument>) {
9263 self.coins_to_merge = field;
9264 }
9265 pub fn with_coins_to_merge(mut self, field: Vec<super::Argument>) -> Self {
9267 self.set_coins_to_merge(field);
9268 self
9269 }
9270 }
9271 impl super::Module {
9272 pub const fn const_default() -> Self {
9273 Self {
9274 name: None,
9275 contents: None,
9276 datatypes: Vec::new(),
9277 functions: Vec::new(),
9278 }
9279 }
9280 #[doc(hidden)]
9281 pub fn default_instance() -> &'static Self {
9282 static DEFAULT: super::Module = super::Module::const_default();
9283 &DEFAULT
9284 }
9285 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
9287 self.name.as_mut().map(|field| field as _)
9288 }
9289 pub fn name_mut(&mut self) -> &mut String {
9292 self.name.get_or_insert_default()
9293 }
9294 pub fn name_opt(&self) -> Option<&str> {
9296 self.name.as_ref().map(|field| field as _)
9297 }
9298 pub fn set_name<T: Into<String>>(&mut self, field: T) {
9300 self.name = Some(field.into().into());
9301 }
9302 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
9304 self.set_name(field.into());
9305 self
9306 }
9307 pub fn contents_opt(&self) -> Option<&[u8]> {
9309 self.contents.as_ref().map(|field| field as _)
9310 }
9311 pub fn set_contents<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
9313 self.contents = Some(field.into().into());
9314 }
9315 pub fn with_contents<T: Into<::prost::bytes::Bytes>>(
9317 mut self,
9318 field: T,
9319 ) -> Self {
9320 self.set_contents(field.into());
9321 self
9322 }
9323 pub fn datatypes(&self) -> &[super::DatatypeDescriptor] {
9325 &self.datatypes
9326 }
9327 pub fn datatypes_mut(&mut self) -> &mut Vec<super::DatatypeDescriptor> {
9330 &mut self.datatypes
9331 }
9332 pub fn set_datatypes(&mut self, field: Vec<super::DatatypeDescriptor>) {
9334 self.datatypes = field;
9335 }
9336 pub fn with_datatypes(mut self, field: Vec<super::DatatypeDescriptor>) -> Self {
9338 self.set_datatypes(field);
9339 self
9340 }
9341 pub fn functions(&self) -> &[super::FunctionDescriptor] {
9343 &self.functions
9344 }
9345 pub fn functions_mut(&mut self) -> &mut Vec<super::FunctionDescriptor> {
9348 &mut self.functions
9349 }
9350 pub fn set_functions(&mut self, field: Vec<super::FunctionDescriptor>) {
9352 self.functions = field;
9353 }
9354 pub fn with_functions(mut self, field: Vec<super::FunctionDescriptor>) -> Self {
9356 self.set_functions(field);
9357 self
9358 }
9359 }
9360 impl super::MoveAbort {
9361 pub const fn const_default() -> Self {
9362 Self {
9363 abort_code: None,
9364 location: None,
9365 clever_error: None,
9366 }
9367 }
9368 #[doc(hidden)]
9369 pub fn default_instance() -> &'static Self {
9370 static DEFAULT: super::MoveAbort = super::MoveAbort::const_default();
9371 &DEFAULT
9372 }
9373 pub fn abort_code_opt_mut(&mut self) -> Option<&mut u64> {
9375 self.abort_code.as_mut().map(|field| field as _)
9376 }
9377 pub fn abort_code_mut(&mut self) -> &mut u64 {
9380 self.abort_code.get_or_insert_default()
9381 }
9382 pub fn abort_code_opt(&self) -> Option<u64> {
9384 self.abort_code.as_ref().map(|field| *field)
9385 }
9386 pub fn set_abort_code<T: Into<u64>>(&mut self, field: T) {
9388 self.abort_code = Some(field.into().into());
9389 }
9390 pub fn with_abort_code<T: Into<u64>>(mut self, field: T) -> Self {
9392 self.set_abort_code(field.into());
9393 self
9394 }
9395 pub fn location(&self) -> &super::MoveLocation {
9397 self.location
9398 .as_ref()
9399 .map(|field| field as _)
9400 .unwrap_or_else(|| super::MoveLocation::default_instance() as _)
9401 }
9402 pub fn location_opt_mut(&mut self) -> Option<&mut super::MoveLocation> {
9404 self.location.as_mut().map(|field| field as _)
9405 }
9406 pub fn location_mut(&mut self) -> &mut super::MoveLocation {
9409 self.location.get_or_insert_default()
9410 }
9411 pub fn location_opt(&self) -> Option<&super::MoveLocation> {
9413 self.location.as_ref().map(|field| field as _)
9414 }
9415 pub fn set_location<T: Into<super::MoveLocation>>(&mut self, field: T) {
9417 self.location = Some(field.into().into());
9418 }
9419 pub fn with_location<T: Into<super::MoveLocation>>(mut self, field: T) -> Self {
9421 self.set_location(field.into());
9422 self
9423 }
9424 pub fn clever_error(&self) -> &super::CleverError {
9426 self.clever_error
9427 .as_ref()
9428 .map(|field| field as _)
9429 .unwrap_or_else(|| super::CleverError::default_instance() as _)
9430 }
9431 pub fn clever_error_opt_mut(&mut self) -> Option<&mut super::CleverError> {
9433 self.clever_error.as_mut().map(|field| field as _)
9434 }
9435 pub fn clever_error_mut(&mut self) -> &mut super::CleverError {
9438 self.clever_error.get_or_insert_default()
9439 }
9440 pub fn clever_error_opt(&self) -> Option<&super::CleverError> {
9442 self.clever_error.as_ref().map(|field| field as _)
9443 }
9444 pub fn set_clever_error<T: Into<super::CleverError>>(&mut self, field: T) {
9446 self.clever_error = Some(field.into().into());
9447 }
9448 pub fn with_clever_error<T: Into<super::CleverError>>(
9450 mut self,
9451 field: T,
9452 ) -> Self {
9453 self.set_clever_error(field.into());
9454 self
9455 }
9456 }
9457 impl super::MoveCall {
9458 pub const fn const_default() -> Self {
9459 Self {
9460 package: None,
9461 module: None,
9462 function: None,
9463 type_arguments: Vec::new(),
9464 arguments: Vec::new(),
9465 }
9466 }
9467 #[doc(hidden)]
9468 pub fn default_instance() -> &'static Self {
9469 static DEFAULT: super::MoveCall = super::MoveCall::const_default();
9470 &DEFAULT
9471 }
9472 pub fn package_opt_mut(&mut self) -> Option<&mut String> {
9474 self.package.as_mut().map(|field| field as _)
9475 }
9476 pub fn package_mut(&mut self) -> &mut String {
9479 self.package.get_or_insert_default()
9480 }
9481 pub fn package_opt(&self) -> Option<&str> {
9483 self.package.as_ref().map(|field| field as _)
9484 }
9485 pub fn set_package<T: Into<String>>(&mut self, field: T) {
9487 self.package = Some(field.into().into());
9488 }
9489 pub fn with_package<T: Into<String>>(mut self, field: T) -> Self {
9491 self.set_package(field.into());
9492 self
9493 }
9494 pub fn module_opt_mut(&mut self) -> Option<&mut String> {
9496 self.module.as_mut().map(|field| field as _)
9497 }
9498 pub fn module_mut(&mut self) -> &mut String {
9501 self.module.get_or_insert_default()
9502 }
9503 pub fn module_opt(&self) -> Option<&str> {
9505 self.module.as_ref().map(|field| field as _)
9506 }
9507 pub fn set_module<T: Into<String>>(&mut self, field: T) {
9509 self.module = Some(field.into().into());
9510 }
9511 pub fn with_module<T: Into<String>>(mut self, field: T) -> Self {
9513 self.set_module(field.into());
9514 self
9515 }
9516 pub fn function_opt_mut(&mut self) -> Option<&mut String> {
9518 self.function.as_mut().map(|field| field as _)
9519 }
9520 pub fn function_mut(&mut self) -> &mut String {
9523 self.function.get_or_insert_default()
9524 }
9525 pub fn function_opt(&self) -> Option<&str> {
9527 self.function.as_ref().map(|field| field as _)
9528 }
9529 pub fn set_function<T: Into<String>>(&mut self, field: T) {
9531 self.function = Some(field.into().into());
9532 }
9533 pub fn with_function<T: Into<String>>(mut self, field: T) -> Self {
9535 self.set_function(field.into());
9536 self
9537 }
9538 pub fn type_arguments(&self) -> &[String] {
9540 &self.type_arguments
9541 }
9542 pub fn type_arguments_mut(&mut self) -> &mut Vec<String> {
9545 &mut self.type_arguments
9546 }
9547 pub fn set_type_arguments(&mut self, field: Vec<String>) {
9549 self.type_arguments = field;
9550 }
9551 pub fn with_type_arguments(mut self, field: Vec<String>) -> Self {
9553 self.set_type_arguments(field);
9554 self
9555 }
9556 pub fn arguments(&self) -> &[super::Argument] {
9558 &self.arguments
9559 }
9560 pub fn arguments_mut(&mut self) -> &mut Vec<super::Argument> {
9563 &mut self.arguments
9564 }
9565 pub fn set_arguments(&mut self, field: Vec<super::Argument>) {
9567 self.arguments = field;
9568 }
9569 pub fn with_arguments(mut self, field: Vec<super::Argument>) -> Self {
9571 self.set_arguments(field);
9572 self
9573 }
9574 }
9575 impl super::MoveLocation {
9576 pub const fn const_default() -> Self {
9577 Self {
9578 package: None,
9579 module: None,
9580 function: None,
9581 instruction: None,
9582 function_name: None,
9583 }
9584 }
9585 #[doc(hidden)]
9586 pub fn default_instance() -> &'static Self {
9587 static DEFAULT: super::MoveLocation = super::MoveLocation::const_default();
9588 &DEFAULT
9589 }
9590 pub fn package_opt_mut(&mut self) -> Option<&mut String> {
9592 self.package.as_mut().map(|field| field as _)
9593 }
9594 pub fn package_mut(&mut self) -> &mut String {
9597 self.package.get_or_insert_default()
9598 }
9599 pub fn package_opt(&self) -> Option<&str> {
9601 self.package.as_ref().map(|field| field as _)
9602 }
9603 pub fn set_package<T: Into<String>>(&mut self, field: T) {
9605 self.package = Some(field.into().into());
9606 }
9607 pub fn with_package<T: Into<String>>(mut self, field: T) -> Self {
9609 self.set_package(field.into());
9610 self
9611 }
9612 pub fn module_opt_mut(&mut self) -> Option<&mut String> {
9614 self.module.as_mut().map(|field| field as _)
9615 }
9616 pub fn module_mut(&mut self) -> &mut String {
9619 self.module.get_or_insert_default()
9620 }
9621 pub fn module_opt(&self) -> Option<&str> {
9623 self.module.as_ref().map(|field| field as _)
9624 }
9625 pub fn set_module<T: Into<String>>(&mut self, field: T) {
9627 self.module = Some(field.into().into());
9628 }
9629 pub fn with_module<T: Into<String>>(mut self, field: T) -> Self {
9631 self.set_module(field.into());
9632 self
9633 }
9634 pub fn function_opt_mut(&mut self) -> Option<&mut u32> {
9636 self.function.as_mut().map(|field| field as _)
9637 }
9638 pub fn function_mut(&mut self) -> &mut u32 {
9641 self.function.get_or_insert_default()
9642 }
9643 pub fn function_opt(&self) -> Option<u32> {
9645 self.function.as_ref().map(|field| *field)
9646 }
9647 pub fn set_function<T: Into<u32>>(&mut self, field: T) {
9649 self.function = Some(field.into().into());
9650 }
9651 pub fn with_function<T: Into<u32>>(mut self, field: T) -> Self {
9653 self.set_function(field.into());
9654 self
9655 }
9656 pub fn instruction_opt_mut(&mut self) -> Option<&mut u32> {
9658 self.instruction.as_mut().map(|field| field as _)
9659 }
9660 pub fn instruction_mut(&mut self) -> &mut u32 {
9663 self.instruction.get_or_insert_default()
9664 }
9665 pub fn instruction_opt(&self) -> Option<u32> {
9667 self.instruction.as_ref().map(|field| *field)
9668 }
9669 pub fn set_instruction<T: Into<u32>>(&mut self, field: T) {
9671 self.instruction = Some(field.into().into());
9672 }
9673 pub fn with_instruction<T: Into<u32>>(mut self, field: T) -> Self {
9675 self.set_instruction(field.into());
9676 self
9677 }
9678 pub fn function_name_opt_mut(&mut self) -> Option<&mut String> {
9680 self.function_name.as_mut().map(|field| field as _)
9681 }
9682 pub fn function_name_mut(&mut self) -> &mut String {
9685 self.function_name.get_or_insert_default()
9686 }
9687 pub fn function_name_opt(&self) -> Option<&str> {
9689 self.function_name.as_ref().map(|field| field as _)
9690 }
9691 pub fn set_function_name<T: Into<String>>(&mut self, field: T) {
9693 self.function_name = Some(field.into().into());
9694 }
9695 pub fn with_function_name<T: Into<String>>(mut self, field: T) -> Self {
9697 self.set_function_name(field.into());
9698 self
9699 }
9700 }
9701 impl super::MoveTable {
9702 pub const fn const_default() -> Self {
9703 Self { id: None, size: None }
9704 }
9705 #[doc(hidden)]
9706 pub fn default_instance() -> &'static Self {
9707 static DEFAULT: super::MoveTable = super::MoveTable::const_default();
9708 &DEFAULT
9709 }
9710 pub fn id_opt_mut(&mut self) -> Option<&mut String> {
9712 self.id.as_mut().map(|field| field as _)
9713 }
9714 pub fn id_mut(&mut self) -> &mut String {
9717 self.id.get_or_insert_default()
9718 }
9719 pub fn id_opt(&self) -> Option<&str> {
9721 self.id.as_ref().map(|field| field as _)
9722 }
9723 pub fn set_id<T: Into<String>>(&mut self, field: T) {
9725 self.id = Some(field.into().into());
9726 }
9727 pub fn with_id<T: Into<String>>(mut self, field: T) -> Self {
9729 self.set_id(field.into());
9730 self
9731 }
9732 pub fn size_opt_mut(&mut self) -> Option<&mut u64> {
9734 self.size.as_mut().map(|field| field as _)
9735 }
9736 pub fn size_mut(&mut self) -> &mut u64 {
9739 self.size.get_or_insert_default()
9740 }
9741 pub fn size_opt(&self) -> Option<u64> {
9743 self.size.as_ref().map(|field| *field)
9744 }
9745 pub fn set_size<T: Into<u64>>(&mut self, field: T) {
9747 self.size = Some(field.into().into());
9748 }
9749 pub fn with_size<T: Into<u64>>(mut self, field: T) -> Self {
9751 self.set_size(field.into());
9752 self
9753 }
9754 }
9755 impl super::MultisigAggregatedSignature {
9756 pub const fn const_default() -> Self {
9757 Self {
9758 signatures: Vec::new(),
9759 bitmap: None,
9760 legacy_bitmap: Vec::new(),
9761 committee: None,
9762 }
9763 }
9764 #[doc(hidden)]
9765 pub fn default_instance() -> &'static Self {
9766 static DEFAULT: super::MultisigAggregatedSignature = super::MultisigAggregatedSignature::const_default();
9767 &DEFAULT
9768 }
9769 pub fn signatures(&self) -> &[super::MultisigMemberSignature] {
9771 &self.signatures
9772 }
9773 pub fn signatures_mut(&mut self) -> &mut Vec<super::MultisigMemberSignature> {
9776 &mut self.signatures
9777 }
9778 pub fn set_signatures(&mut self, field: Vec<super::MultisigMemberSignature>) {
9780 self.signatures = field;
9781 }
9782 pub fn with_signatures(
9784 mut self,
9785 field: Vec<super::MultisigMemberSignature>,
9786 ) -> Self {
9787 self.set_signatures(field);
9788 self
9789 }
9790 pub fn bitmap_opt_mut(&mut self) -> Option<&mut u32> {
9792 self.bitmap.as_mut().map(|field| field as _)
9793 }
9794 pub fn bitmap_mut(&mut self) -> &mut u32 {
9797 self.bitmap.get_or_insert_default()
9798 }
9799 pub fn bitmap_opt(&self) -> Option<u32> {
9801 self.bitmap.as_ref().map(|field| *field)
9802 }
9803 pub fn set_bitmap<T: Into<u32>>(&mut self, field: T) {
9805 self.bitmap = Some(field.into().into());
9806 }
9807 pub fn with_bitmap<T: Into<u32>>(mut self, field: T) -> Self {
9809 self.set_bitmap(field.into());
9810 self
9811 }
9812 pub fn legacy_bitmap(&self) -> &[u32] {
9814 &self.legacy_bitmap
9815 }
9816 pub fn legacy_bitmap_mut(&mut self) -> &mut Vec<u32> {
9819 &mut self.legacy_bitmap
9820 }
9821 pub fn set_legacy_bitmap(&mut self, field: Vec<u32>) {
9823 self.legacy_bitmap = field;
9824 }
9825 pub fn with_legacy_bitmap(mut self, field: Vec<u32>) -> Self {
9827 self.set_legacy_bitmap(field);
9828 self
9829 }
9830 pub fn committee(&self) -> &super::MultisigCommittee {
9832 self.committee
9833 .as_ref()
9834 .map(|field| field as _)
9835 .unwrap_or_else(|| super::MultisigCommittee::default_instance() as _)
9836 }
9837 pub fn committee_opt_mut(&mut self) -> Option<&mut super::MultisigCommittee> {
9839 self.committee.as_mut().map(|field| field as _)
9840 }
9841 pub fn committee_mut(&mut self) -> &mut super::MultisigCommittee {
9844 self.committee.get_or_insert_default()
9845 }
9846 pub fn committee_opt(&self) -> Option<&super::MultisigCommittee> {
9848 self.committee.as_ref().map(|field| field as _)
9849 }
9850 pub fn set_committee<T: Into<super::MultisigCommittee>>(&mut self, field: T) {
9852 self.committee = Some(field.into().into());
9853 }
9854 pub fn with_committee<T: Into<super::MultisigCommittee>>(
9856 mut self,
9857 field: T,
9858 ) -> Self {
9859 self.set_committee(field.into());
9860 self
9861 }
9862 }
9863 impl super::MultisigCommittee {
9864 pub const fn const_default() -> Self {
9865 Self {
9866 members: Vec::new(),
9867 threshold: None,
9868 }
9869 }
9870 #[doc(hidden)]
9871 pub fn default_instance() -> &'static Self {
9872 static DEFAULT: super::MultisigCommittee = super::MultisigCommittee::const_default();
9873 &DEFAULT
9874 }
9875 pub fn members(&self) -> &[super::MultisigMember] {
9877 &self.members
9878 }
9879 pub fn members_mut(&mut self) -> &mut Vec<super::MultisigMember> {
9882 &mut self.members
9883 }
9884 pub fn set_members(&mut self, field: Vec<super::MultisigMember>) {
9886 self.members = field;
9887 }
9888 pub fn with_members(mut self, field: Vec<super::MultisigMember>) -> Self {
9890 self.set_members(field);
9891 self
9892 }
9893 pub fn threshold_opt_mut(&mut self) -> Option<&mut u32> {
9895 self.threshold.as_mut().map(|field| field as _)
9896 }
9897 pub fn threshold_mut(&mut self) -> &mut u32 {
9900 self.threshold.get_or_insert_default()
9901 }
9902 pub fn threshold_opt(&self) -> Option<u32> {
9904 self.threshold.as_ref().map(|field| *field)
9905 }
9906 pub fn set_threshold<T: Into<u32>>(&mut self, field: T) {
9908 self.threshold = Some(field.into().into());
9909 }
9910 pub fn with_threshold<T: Into<u32>>(mut self, field: T) -> Self {
9912 self.set_threshold(field.into());
9913 self
9914 }
9915 }
9916 impl super::MultisigMember {
9917 pub const fn const_default() -> Self {
9918 Self {
9919 public_key: None,
9920 weight: None,
9921 }
9922 }
9923 #[doc(hidden)]
9924 pub fn default_instance() -> &'static Self {
9925 static DEFAULT: super::MultisigMember = super::MultisigMember::const_default();
9926 &DEFAULT
9927 }
9928 pub fn public_key(&self) -> &super::MultisigMemberPublicKey {
9930 self.public_key
9931 .as_ref()
9932 .map(|field| field as _)
9933 .unwrap_or_else(|| {
9934 super::MultisigMemberPublicKey::default_instance() as _
9935 })
9936 }
9937 pub fn public_key_opt_mut(
9939 &mut self,
9940 ) -> Option<&mut super::MultisigMemberPublicKey> {
9941 self.public_key.as_mut().map(|field| field as _)
9942 }
9943 pub fn public_key_mut(&mut self) -> &mut super::MultisigMemberPublicKey {
9946 self.public_key.get_or_insert_default()
9947 }
9948 pub fn public_key_opt(&self) -> Option<&super::MultisigMemberPublicKey> {
9950 self.public_key.as_ref().map(|field| field as _)
9951 }
9952 pub fn set_public_key<T: Into<super::MultisigMemberPublicKey>>(
9954 &mut self,
9955 field: T,
9956 ) {
9957 self.public_key = Some(field.into().into());
9958 }
9959 pub fn with_public_key<T: Into<super::MultisigMemberPublicKey>>(
9961 mut self,
9962 field: T,
9963 ) -> Self {
9964 self.set_public_key(field.into());
9965 self
9966 }
9967 pub fn weight_opt_mut(&mut self) -> Option<&mut u32> {
9969 self.weight.as_mut().map(|field| field as _)
9970 }
9971 pub fn weight_mut(&mut self) -> &mut u32 {
9974 self.weight.get_or_insert_default()
9975 }
9976 pub fn weight_opt(&self) -> Option<u32> {
9978 self.weight.as_ref().map(|field| *field)
9979 }
9980 pub fn set_weight<T: Into<u32>>(&mut self, field: T) {
9982 self.weight = Some(field.into().into());
9983 }
9984 pub fn with_weight<T: Into<u32>>(mut self, field: T) -> Self {
9986 self.set_weight(field.into());
9987 self
9988 }
9989 }
9990 impl super::MultisigMemberPublicKey {
9991 pub const fn const_default() -> Self {
9992 Self {
9993 scheme: None,
9994 public_key: None,
9995 zklogin: None,
9996 }
9997 }
9998 #[doc(hidden)]
9999 pub fn default_instance() -> &'static Self {
10000 static DEFAULT: super::MultisigMemberPublicKey = super::MultisigMemberPublicKey::const_default();
10001 &DEFAULT
10002 }
10003 pub fn with_scheme<T: Into<super::SignatureScheme>>(mut self, field: T) -> Self {
10005 self.set_scheme(field.into());
10006 self
10007 }
10008 pub fn public_key_opt(&self) -> Option<&[u8]> {
10010 self.public_key.as_ref().map(|field| field as _)
10011 }
10012 pub fn set_public_key<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
10014 self.public_key = Some(field.into().into());
10015 }
10016 pub fn with_public_key<T: Into<::prost::bytes::Bytes>>(
10018 mut self,
10019 field: T,
10020 ) -> Self {
10021 self.set_public_key(field.into());
10022 self
10023 }
10024 pub fn zklogin(&self) -> &super::ZkLoginPublicIdentifier {
10026 self.zklogin
10027 .as_ref()
10028 .map(|field| field as _)
10029 .unwrap_or_else(|| {
10030 super::ZkLoginPublicIdentifier::default_instance() as _
10031 })
10032 }
10033 pub fn zklogin_opt_mut(
10035 &mut self,
10036 ) -> Option<&mut super::ZkLoginPublicIdentifier> {
10037 self.zklogin.as_mut().map(|field| field as _)
10038 }
10039 pub fn zklogin_mut(&mut self) -> &mut super::ZkLoginPublicIdentifier {
10042 self.zklogin.get_or_insert_default()
10043 }
10044 pub fn zklogin_opt(&self) -> Option<&super::ZkLoginPublicIdentifier> {
10046 self.zklogin.as_ref().map(|field| field as _)
10047 }
10048 pub fn set_zklogin<T: Into<super::ZkLoginPublicIdentifier>>(
10050 &mut self,
10051 field: T,
10052 ) {
10053 self.zklogin = Some(field.into().into());
10054 }
10055 pub fn with_zklogin<T: Into<super::ZkLoginPublicIdentifier>>(
10057 mut self,
10058 field: T,
10059 ) -> Self {
10060 self.set_zklogin(field.into());
10061 self
10062 }
10063 }
10064 impl super::MultisigMemberSignature {
10065 pub const fn const_default() -> Self {
10066 Self {
10067 scheme: None,
10068 signature: None,
10069 zklogin: None,
10070 passkey: None,
10071 }
10072 }
10073 #[doc(hidden)]
10074 pub fn default_instance() -> &'static Self {
10075 static DEFAULT: super::MultisigMemberSignature = super::MultisigMemberSignature::const_default();
10076 &DEFAULT
10077 }
10078 pub fn with_scheme<T: Into<super::SignatureScheme>>(mut self, field: T) -> Self {
10080 self.set_scheme(field.into());
10081 self
10082 }
10083 pub fn signature_opt(&self) -> Option<&[u8]> {
10085 self.signature.as_ref().map(|field| field as _)
10086 }
10087 pub fn set_signature<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
10089 self.signature = Some(field.into().into());
10090 }
10091 pub fn with_signature<T: Into<::prost::bytes::Bytes>>(
10093 mut self,
10094 field: T,
10095 ) -> Self {
10096 self.set_signature(field.into());
10097 self
10098 }
10099 pub fn zklogin(&self) -> &super::ZkLoginAuthenticator {
10101 self.zklogin
10102 .as_ref()
10103 .map(|field| field as _)
10104 .unwrap_or_else(|| super::ZkLoginAuthenticator::default_instance() as _)
10105 }
10106 pub fn zklogin_opt_mut(&mut self) -> Option<&mut super::ZkLoginAuthenticator> {
10108 self.zklogin.as_mut().map(|field| field as _)
10109 }
10110 pub fn zklogin_mut(&mut self) -> &mut super::ZkLoginAuthenticator {
10113 self.zklogin.get_or_insert_default()
10114 }
10115 pub fn zklogin_opt(&self) -> Option<&super::ZkLoginAuthenticator> {
10117 self.zklogin.as_ref().map(|field| field as _)
10118 }
10119 pub fn set_zklogin<T: Into<super::ZkLoginAuthenticator>>(&mut self, field: T) {
10121 self.zklogin = Some(field.into().into());
10122 }
10123 pub fn with_zklogin<T: Into<super::ZkLoginAuthenticator>>(
10125 mut self,
10126 field: T,
10127 ) -> Self {
10128 self.set_zklogin(field.into());
10129 self
10130 }
10131 pub fn passkey(&self) -> &super::PasskeyAuthenticator {
10133 self.passkey
10134 .as_ref()
10135 .map(|field| field as _)
10136 .unwrap_or_else(|| super::PasskeyAuthenticator::default_instance() as _)
10137 }
10138 pub fn passkey_opt_mut(&mut self) -> Option<&mut super::PasskeyAuthenticator> {
10140 self.passkey.as_mut().map(|field| field as _)
10141 }
10142 pub fn passkey_mut(&mut self) -> &mut super::PasskeyAuthenticator {
10145 self.passkey.get_or_insert_default()
10146 }
10147 pub fn passkey_opt(&self) -> Option<&super::PasskeyAuthenticator> {
10149 self.passkey.as_ref().map(|field| field as _)
10150 }
10151 pub fn set_passkey<T: Into<super::PasskeyAuthenticator>>(&mut self, field: T) {
10153 self.passkey = Some(field.into().into());
10154 }
10155 pub fn with_passkey<T: Into<super::PasskeyAuthenticator>>(
10157 mut self,
10158 field: T,
10159 ) -> Self {
10160 self.set_passkey(field.into());
10161 self
10162 }
10163 }
10164 impl super::NameRecord {
10165 pub const fn const_default() -> Self {
10166 Self {
10167 id: None,
10168 name: None,
10169 registration_nft_id: None,
10170 expiration_timestamp: None,
10171 target_address: None,
10172 data: std::collections::BTreeMap::new(),
10173 }
10174 }
10175 #[doc(hidden)]
10176 pub fn default_instance() -> &'static Self {
10177 static DEFAULT: super::NameRecord = super::NameRecord::const_default();
10178 &DEFAULT
10179 }
10180 pub fn id_opt_mut(&mut self) -> Option<&mut String> {
10182 self.id.as_mut().map(|field| field as _)
10183 }
10184 pub fn id_mut(&mut self) -> &mut String {
10187 self.id.get_or_insert_default()
10188 }
10189 pub fn id_opt(&self) -> Option<&str> {
10191 self.id.as_ref().map(|field| field as _)
10192 }
10193 pub fn set_id<T: Into<String>>(&mut self, field: T) {
10195 self.id = Some(field.into().into());
10196 }
10197 pub fn with_id<T: Into<String>>(mut self, field: T) -> Self {
10199 self.set_id(field.into());
10200 self
10201 }
10202 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
10204 self.name.as_mut().map(|field| field as _)
10205 }
10206 pub fn name_mut(&mut self) -> &mut String {
10209 self.name.get_or_insert_default()
10210 }
10211 pub fn name_opt(&self) -> Option<&str> {
10213 self.name.as_ref().map(|field| field as _)
10214 }
10215 pub fn set_name<T: Into<String>>(&mut self, field: T) {
10217 self.name = Some(field.into().into());
10218 }
10219 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
10221 self.set_name(field.into());
10222 self
10223 }
10224 pub fn registration_nft_id_opt_mut(&mut self) -> Option<&mut String> {
10226 self.registration_nft_id.as_mut().map(|field| field as _)
10227 }
10228 pub fn registration_nft_id_mut(&mut self) -> &mut String {
10231 self.registration_nft_id.get_or_insert_default()
10232 }
10233 pub fn registration_nft_id_opt(&self) -> Option<&str> {
10235 self.registration_nft_id.as_ref().map(|field| field as _)
10236 }
10237 pub fn set_registration_nft_id<T: Into<String>>(&mut self, field: T) {
10239 self.registration_nft_id = Some(field.into().into());
10240 }
10241 pub fn with_registration_nft_id<T: Into<String>>(mut self, field: T) -> Self {
10243 self.set_registration_nft_id(field.into());
10244 self
10245 }
10246 pub fn expiration_timestamp_opt_mut(
10248 &mut self,
10249 ) -> Option<&mut ::prost_types::Timestamp> {
10250 self.expiration_timestamp.as_mut().map(|field| field as _)
10251 }
10252 pub fn expiration_timestamp_mut(&mut self) -> &mut ::prost_types::Timestamp {
10255 self.expiration_timestamp.get_or_insert_default()
10256 }
10257 pub fn expiration_timestamp_opt(&self) -> Option<&::prost_types::Timestamp> {
10259 self.expiration_timestamp.as_ref().map(|field| field as _)
10260 }
10261 pub fn set_expiration_timestamp<T: Into<::prost_types::Timestamp>>(
10263 &mut self,
10264 field: T,
10265 ) {
10266 self.expiration_timestamp = Some(field.into().into());
10267 }
10268 pub fn with_expiration_timestamp<T: Into<::prost_types::Timestamp>>(
10270 mut self,
10271 field: T,
10272 ) -> Self {
10273 self.set_expiration_timestamp(field.into());
10274 self
10275 }
10276 pub fn target_address_opt_mut(&mut self) -> Option<&mut String> {
10278 self.target_address.as_mut().map(|field| field as _)
10279 }
10280 pub fn target_address_mut(&mut self) -> &mut String {
10283 self.target_address.get_or_insert_default()
10284 }
10285 pub fn target_address_opt(&self) -> Option<&str> {
10287 self.target_address.as_ref().map(|field| field as _)
10288 }
10289 pub fn set_target_address<T: Into<String>>(&mut self, field: T) {
10291 self.target_address = Some(field.into().into());
10292 }
10293 pub fn with_target_address<T: Into<String>>(mut self, field: T) -> Self {
10295 self.set_target_address(field.into());
10296 self
10297 }
10298 pub fn data(&self) -> &::std::collections::BTreeMap<String, String> {
10300 &self.data
10301 }
10302 pub fn data_mut(&mut self) -> &mut ::std::collections::BTreeMap<String, String> {
10305 &mut self.data
10306 }
10307 pub fn set_data(&mut self, field: ::std::collections::BTreeMap<String, String>) {
10309 self.data = field;
10310 }
10311 pub fn with_data(
10313 mut self,
10314 field: ::std::collections::BTreeMap<String, String>,
10315 ) -> Self {
10316 self.set_data(field);
10317 self
10318 }
10319 }
10320 impl super::Object {
10321 pub const fn const_default() -> Self {
10322 Self {
10323 bcs: None,
10324 object_id: None,
10325 version: None,
10326 digest: None,
10327 owner: None,
10328 object_type: None,
10329 has_public_transfer: None,
10330 contents: None,
10331 package: None,
10332 previous_transaction: None,
10333 storage_rebate: None,
10334 json: None,
10335 balance: None,
10336 }
10337 }
10338 #[doc(hidden)]
10339 pub fn default_instance() -> &'static Self {
10340 static DEFAULT: super::Object = super::Object::const_default();
10341 &DEFAULT
10342 }
10343 pub fn bcs(&self) -> &super::Bcs {
10345 self.bcs
10346 .as_ref()
10347 .map(|field| field as _)
10348 .unwrap_or_else(|| super::Bcs::default_instance() as _)
10349 }
10350 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
10352 self.bcs.as_mut().map(|field| field as _)
10353 }
10354 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
10357 self.bcs.get_or_insert_default()
10358 }
10359 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
10361 self.bcs.as_ref().map(|field| field as _)
10362 }
10363 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
10365 self.bcs = Some(field.into().into());
10366 }
10367 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
10369 self.set_bcs(field.into());
10370 self
10371 }
10372 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
10374 self.object_id.as_mut().map(|field| field as _)
10375 }
10376 pub fn object_id_mut(&mut self) -> &mut String {
10379 self.object_id.get_or_insert_default()
10380 }
10381 pub fn object_id_opt(&self) -> Option<&str> {
10383 self.object_id.as_ref().map(|field| field as _)
10384 }
10385 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
10387 self.object_id = Some(field.into().into());
10388 }
10389 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
10391 self.set_object_id(field.into());
10392 self
10393 }
10394 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
10396 self.version.as_mut().map(|field| field as _)
10397 }
10398 pub fn version_mut(&mut self) -> &mut u64 {
10401 self.version.get_or_insert_default()
10402 }
10403 pub fn version_opt(&self) -> Option<u64> {
10405 self.version.as_ref().map(|field| *field)
10406 }
10407 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
10409 self.version = Some(field.into().into());
10410 }
10411 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
10413 self.set_version(field.into());
10414 self
10415 }
10416 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
10418 self.digest.as_mut().map(|field| field as _)
10419 }
10420 pub fn digest_mut(&mut self) -> &mut String {
10423 self.digest.get_or_insert_default()
10424 }
10425 pub fn digest_opt(&self) -> Option<&str> {
10427 self.digest.as_ref().map(|field| field as _)
10428 }
10429 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
10431 self.digest = Some(field.into().into());
10432 }
10433 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
10435 self.set_digest(field.into());
10436 self
10437 }
10438 pub fn owner(&self) -> &super::Owner {
10440 self.owner
10441 .as_ref()
10442 .map(|field| field as _)
10443 .unwrap_or_else(|| super::Owner::default_instance() as _)
10444 }
10445 pub fn owner_opt_mut(&mut self) -> Option<&mut super::Owner> {
10447 self.owner.as_mut().map(|field| field as _)
10448 }
10449 pub fn owner_mut(&mut self) -> &mut super::Owner {
10452 self.owner.get_or_insert_default()
10453 }
10454 pub fn owner_opt(&self) -> Option<&super::Owner> {
10456 self.owner.as_ref().map(|field| field as _)
10457 }
10458 pub fn set_owner<T: Into<super::Owner>>(&mut self, field: T) {
10460 self.owner = Some(field.into().into());
10461 }
10462 pub fn with_owner<T: Into<super::Owner>>(mut self, field: T) -> Self {
10464 self.set_owner(field.into());
10465 self
10466 }
10467 pub fn object_type_opt_mut(&mut self) -> Option<&mut String> {
10469 self.object_type.as_mut().map(|field| field as _)
10470 }
10471 pub fn object_type_mut(&mut self) -> &mut String {
10474 self.object_type.get_or_insert_default()
10475 }
10476 pub fn object_type_opt(&self) -> Option<&str> {
10478 self.object_type.as_ref().map(|field| field as _)
10479 }
10480 pub fn set_object_type<T: Into<String>>(&mut self, field: T) {
10482 self.object_type = Some(field.into().into());
10483 }
10484 pub fn with_object_type<T: Into<String>>(mut self, field: T) -> Self {
10486 self.set_object_type(field.into());
10487 self
10488 }
10489 pub fn has_public_transfer_opt_mut(&mut self) -> Option<&mut bool> {
10491 self.has_public_transfer.as_mut().map(|field| field as _)
10492 }
10493 pub fn has_public_transfer_mut(&mut self) -> &mut bool {
10496 self.has_public_transfer.get_or_insert_default()
10497 }
10498 pub fn has_public_transfer_opt(&self) -> Option<bool> {
10500 self.has_public_transfer.as_ref().map(|field| *field)
10501 }
10502 pub fn set_has_public_transfer<T: Into<bool>>(&mut self, field: T) {
10504 self.has_public_transfer = Some(field.into().into());
10505 }
10506 pub fn with_has_public_transfer<T: Into<bool>>(mut self, field: T) -> Self {
10508 self.set_has_public_transfer(field.into());
10509 self
10510 }
10511 pub fn contents(&self) -> &super::Bcs {
10513 self.contents
10514 .as_ref()
10515 .map(|field| field as _)
10516 .unwrap_or_else(|| super::Bcs::default_instance() as _)
10517 }
10518 pub fn contents_opt_mut(&mut self) -> Option<&mut super::Bcs> {
10520 self.contents.as_mut().map(|field| field as _)
10521 }
10522 pub fn contents_mut(&mut self) -> &mut super::Bcs {
10525 self.contents.get_or_insert_default()
10526 }
10527 pub fn contents_opt(&self) -> Option<&super::Bcs> {
10529 self.contents.as_ref().map(|field| field as _)
10530 }
10531 pub fn set_contents<T: Into<super::Bcs>>(&mut self, field: T) {
10533 self.contents = Some(field.into().into());
10534 }
10535 pub fn with_contents<T: Into<super::Bcs>>(mut self, field: T) -> Self {
10537 self.set_contents(field.into());
10538 self
10539 }
10540 pub fn package(&self) -> &super::Package {
10542 self.package
10543 .as_ref()
10544 .map(|field| field as _)
10545 .unwrap_or_else(|| super::Package::default_instance() as _)
10546 }
10547 pub fn package_opt_mut(&mut self) -> Option<&mut super::Package> {
10549 self.package.as_mut().map(|field| field as _)
10550 }
10551 pub fn package_mut(&mut self) -> &mut super::Package {
10554 self.package.get_or_insert_default()
10555 }
10556 pub fn package_opt(&self) -> Option<&super::Package> {
10558 self.package.as_ref().map(|field| field as _)
10559 }
10560 pub fn set_package<T: Into<super::Package>>(&mut self, field: T) {
10562 self.package = Some(field.into().into());
10563 }
10564 pub fn with_package<T: Into<super::Package>>(mut self, field: T) -> Self {
10566 self.set_package(field.into());
10567 self
10568 }
10569 pub fn previous_transaction_opt_mut(&mut self) -> Option<&mut String> {
10571 self.previous_transaction.as_mut().map(|field| field as _)
10572 }
10573 pub fn previous_transaction_mut(&mut self) -> &mut String {
10576 self.previous_transaction.get_or_insert_default()
10577 }
10578 pub fn previous_transaction_opt(&self) -> Option<&str> {
10580 self.previous_transaction.as_ref().map(|field| field as _)
10581 }
10582 pub fn set_previous_transaction<T: Into<String>>(&mut self, field: T) {
10584 self.previous_transaction = Some(field.into().into());
10585 }
10586 pub fn with_previous_transaction<T: Into<String>>(mut self, field: T) -> Self {
10588 self.set_previous_transaction(field.into());
10589 self
10590 }
10591 pub fn storage_rebate_opt_mut(&mut self) -> Option<&mut u64> {
10593 self.storage_rebate.as_mut().map(|field| field as _)
10594 }
10595 pub fn storage_rebate_mut(&mut self) -> &mut u64 {
10598 self.storage_rebate.get_or_insert_default()
10599 }
10600 pub fn storage_rebate_opt(&self) -> Option<u64> {
10602 self.storage_rebate.as_ref().map(|field| *field)
10603 }
10604 pub fn set_storage_rebate<T: Into<u64>>(&mut self, field: T) {
10606 self.storage_rebate = Some(field.into().into());
10607 }
10608 pub fn with_storage_rebate<T: Into<u64>>(mut self, field: T) -> Self {
10610 self.set_storage_rebate(field.into());
10611 self
10612 }
10613 pub fn json_opt_mut(&mut self) -> Option<&mut ::prost_types::Value> {
10615 self.json.as_mut().map(|field| field as _)
10616 }
10617 pub fn json_mut(&mut self) -> &mut ::prost_types::Value {
10620 self.json.get_or_insert_default()
10621 }
10622 pub fn json_opt(&self) -> Option<&::prost_types::Value> {
10624 self.json.as_ref().map(|field| field as _)
10625 }
10626 pub fn set_json<T: Into<::prost_types::Value>>(&mut self, field: T) {
10628 self.json = Some(field.into().into());
10629 }
10630 pub fn with_json<T: Into<::prost_types::Value>>(mut self, field: T) -> Self {
10632 self.set_json(field.into());
10633 self
10634 }
10635 pub fn balance_opt_mut(&mut self) -> Option<&mut u64> {
10637 self.balance.as_mut().map(|field| field as _)
10638 }
10639 pub fn balance_mut(&mut self) -> &mut u64 {
10642 self.balance.get_or_insert_default()
10643 }
10644 pub fn balance_opt(&self) -> Option<u64> {
10646 self.balance.as_ref().map(|field| *field)
10647 }
10648 pub fn set_balance<T: Into<u64>>(&mut self, field: T) {
10650 self.balance = Some(field.into().into());
10651 }
10652 pub fn with_balance<T: Into<u64>>(mut self, field: T) -> Self {
10654 self.set_balance(field.into());
10655 self
10656 }
10657 }
10658 impl super::ObjectReference {
10659 pub const fn const_default() -> Self {
10660 Self {
10661 object_id: None,
10662 version: None,
10663 digest: None,
10664 }
10665 }
10666 #[doc(hidden)]
10667 pub fn default_instance() -> &'static Self {
10668 static DEFAULT: super::ObjectReference = super::ObjectReference::const_default();
10669 &DEFAULT
10670 }
10671 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
10673 self.object_id.as_mut().map(|field| field as _)
10674 }
10675 pub fn object_id_mut(&mut self) -> &mut String {
10678 self.object_id.get_or_insert_default()
10679 }
10680 pub fn object_id_opt(&self) -> Option<&str> {
10682 self.object_id.as_ref().map(|field| field as _)
10683 }
10684 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
10686 self.object_id = Some(field.into().into());
10687 }
10688 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
10690 self.set_object_id(field.into());
10691 self
10692 }
10693 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
10695 self.version.as_mut().map(|field| field as _)
10696 }
10697 pub fn version_mut(&mut self) -> &mut u64 {
10700 self.version.get_or_insert_default()
10701 }
10702 pub fn version_opt(&self) -> Option<u64> {
10704 self.version.as_ref().map(|field| *field)
10705 }
10706 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
10708 self.version = Some(field.into().into());
10709 }
10710 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
10712 self.set_version(field.into());
10713 self
10714 }
10715 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
10717 self.digest.as_mut().map(|field| field as _)
10718 }
10719 pub fn digest_mut(&mut self) -> &mut String {
10722 self.digest.get_or_insert_default()
10723 }
10724 pub fn digest_opt(&self) -> Option<&str> {
10726 self.digest.as_ref().map(|field| field as _)
10727 }
10728 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
10730 self.digest = Some(field.into().into());
10731 }
10732 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
10734 self.set_digest(field.into());
10735 self
10736 }
10737 }
10738 impl super::OpenSignature {
10739 pub const fn const_default() -> Self {
10740 Self {
10741 reference: None,
10742 body: None,
10743 }
10744 }
10745 #[doc(hidden)]
10746 pub fn default_instance() -> &'static Self {
10747 static DEFAULT: super::OpenSignature = super::OpenSignature::const_default();
10748 &DEFAULT
10749 }
10750 pub fn with_reference<T: Into<super::open_signature::Reference>>(
10752 mut self,
10753 field: T,
10754 ) -> Self {
10755 self.set_reference(field.into());
10756 self
10757 }
10758 pub fn body(&self) -> &super::OpenSignatureBody {
10760 self.body
10761 .as_ref()
10762 .map(|field| field as _)
10763 .unwrap_or_else(|| super::OpenSignatureBody::default_instance() as _)
10764 }
10765 pub fn body_opt_mut(&mut self) -> Option<&mut super::OpenSignatureBody> {
10767 self.body.as_mut().map(|field| field as _)
10768 }
10769 pub fn body_mut(&mut self) -> &mut super::OpenSignatureBody {
10772 self.body.get_or_insert_default()
10773 }
10774 pub fn body_opt(&self) -> Option<&super::OpenSignatureBody> {
10776 self.body.as_ref().map(|field| field as _)
10777 }
10778 pub fn set_body<T: Into<super::OpenSignatureBody>>(&mut self, field: T) {
10780 self.body = Some(field.into().into());
10781 }
10782 pub fn with_body<T: Into<super::OpenSignatureBody>>(mut self, field: T) -> Self {
10784 self.set_body(field.into());
10785 self
10786 }
10787 }
10788 impl super::OpenSignatureBody {
10789 pub const fn const_default() -> Self {
10790 Self {
10791 r#type: None,
10792 type_name: None,
10793 type_parameter_instantiation: Vec::new(),
10794 type_parameter: None,
10795 }
10796 }
10797 #[doc(hidden)]
10798 pub fn default_instance() -> &'static Self {
10799 static DEFAULT: super::OpenSignatureBody = super::OpenSignatureBody::const_default();
10800 &DEFAULT
10801 }
10802 pub fn with_type<T: Into<super::open_signature_body::Type>>(
10804 mut self,
10805 field: T,
10806 ) -> Self {
10807 self.set_type(field.into());
10808 self
10809 }
10810 pub fn type_name_opt_mut(&mut self) -> Option<&mut String> {
10812 self.type_name.as_mut().map(|field| field as _)
10813 }
10814 pub fn type_name_mut(&mut self) -> &mut String {
10817 self.type_name.get_or_insert_default()
10818 }
10819 pub fn type_name_opt(&self) -> Option<&str> {
10821 self.type_name.as_ref().map(|field| field as _)
10822 }
10823 pub fn set_type_name<T: Into<String>>(&mut self, field: T) {
10825 self.type_name = Some(field.into().into());
10826 }
10827 pub fn with_type_name<T: Into<String>>(mut self, field: T) -> Self {
10829 self.set_type_name(field.into());
10830 self
10831 }
10832 pub fn type_parameter_instantiation(&self) -> &[super::OpenSignatureBody] {
10834 &self.type_parameter_instantiation
10835 }
10836 pub fn type_parameter_instantiation_mut(
10839 &mut self,
10840 ) -> &mut Vec<super::OpenSignatureBody> {
10841 &mut self.type_parameter_instantiation
10842 }
10843 pub fn set_type_parameter_instantiation(
10845 &mut self,
10846 field: Vec<super::OpenSignatureBody>,
10847 ) {
10848 self.type_parameter_instantiation = field;
10849 }
10850 pub fn with_type_parameter_instantiation(
10852 mut self,
10853 field: Vec<super::OpenSignatureBody>,
10854 ) -> Self {
10855 self.set_type_parameter_instantiation(field);
10856 self
10857 }
10858 pub fn type_parameter_opt_mut(&mut self) -> Option<&mut u32> {
10860 self.type_parameter.as_mut().map(|field| field as _)
10861 }
10862 pub fn type_parameter_mut(&mut self) -> &mut u32 {
10865 self.type_parameter.get_or_insert_default()
10866 }
10867 pub fn type_parameter_opt(&self) -> Option<u32> {
10869 self.type_parameter.as_ref().map(|field| *field)
10870 }
10871 pub fn set_type_parameter<T: Into<u32>>(&mut self, field: T) {
10873 self.type_parameter = Some(field.into().into());
10874 }
10875 pub fn with_type_parameter<T: Into<u32>>(mut self, field: T) -> Self {
10877 self.set_type_parameter(field.into());
10878 self
10879 }
10880 }
10881 impl super::Owner {
10882 pub const fn const_default() -> Self {
10883 Self {
10884 kind: None,
10885 address: None,
10886 version: None,
10887 }
10888 }
10889 #[doc(hidden)]
10890 pub fn default_instance() -> &'static Self {
10891 static DEFAULT: super::Owner = super::Owner::const_default();
10892 &DEFAULT
10893 }
10894 pub fn with_kind<T: Into<super::owner::OwnerKind>>(mut self, field: T) -> Self {
10896 self.set_kind(field.into());
10897 self
10898 }
10899 pub fn address_opt_mut(&mut self) -> Option<&mut String> {
10901 self.address.as_mut().map(|field| field as _)
10902 }
10903 pub fn address_mut(&mut self) -> &mut String {
10906 self.address.get_or_insert_default()
10907 }
10908 pub fn address_opt(&self) -> Option<&str> {
10910 self.address.as_ref().map(|field| field as _)
10911 }
10912 pub fn set_address<T: Into<String>>(&mut self, field: T) {
10914 self.address = Some(field.into().into());
10915 }
10916 pub fn with_address<T: Into<String>>(mut self, field: T) -> Self {
10918 self.set_address(field.into());
10919 self
10920 }
10921 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
10923 self.version.as_mut().map(|field| field as _)
10924 }
10925 pub fn version_mut(&mut self) -> &mut u64 {
10928 self.version.get_or_insert_default()
10929 }
10930 pub fn version_opt(&self) -> Option<u64> {
10932 self.version.as_ref().map(|field| *field)
10933 }
10934 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
10936 self.version = Some(field.into().into());
10937 }
10938 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
10940 self.set_version(field.into());
10941 self
10942 }
10943 }
10944 impl super::Package {
10945 pub const fn const_default() -> Self {
10946 Self {
10947 storage_id: None,
10948 original_id: None,
10949 version: None,
10950 modules: Vec::new(),
10951 type_origins: Vec::new(),
10952 linkage: Vec::new(),
10953 }
10954 }
10955 #[doc(hidden)]
10956 pub fn default_instance() -> &'static Self {
10957 static DEFAULT: super::Package = super::Package::const_default();
10958 &DEFAULT
10959 }
10960 pub fn storage_id_opt_mut(&mut self) -> Option<&mut String> {
10962 self.storage_id.as_mut().map(|field| field as _)
10963 }
10964 pub fn storage_id_mut(&mut self) -> &mut String {
10967 self.storage_id.get_or_insert_default()
10968 }
10969 pub fn storage_id_opt(&self) -> Option<&str> {
10971 self.storage_id.as_ref().map(|field| field as _)
10972 }
10973 pub fn set_storage_id<T: Into<String>>(&mut self, field: T) {
10975 self.storage_id = Some(field.into().into());
10976 }
10977 pub fn with_storage_id<T: Into<String>>(mut self, field: T) -> Self {
10979 self.set_storage_id(field.into());
10980 self
10981 }
10982 pub fn original_id_opt_mut(&mut self) -> Option<&mut String> {
10984 self.original_id.as_mut().map(|field| field as _)
10985 }
10986 pub fn original_id_mut(&mut self) -> &mut String {
10989 self.original_id.get_or_insert_default()
10990 }
10991 pub fn original_id_opt(&self) -> Option<&str> {
10993 self.original_id.as_ref().map(|field| field as _)
10994 }
10995 pub fn set_original_id<T: Into<String>>(&mut self, field: T) {
10997 self.original_id = Some(field.into().into());
10998 }
10999 pub fn with_original_id<T: Into<String>>(mut self, field: T) -> Self {
11001 self.set_original_id(field.into());
11002 self
11003 }
11004 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
11006 self.version.as_mut().map(|field| field as _)
11007 }
11008 pub fn version_mut(&mut self) -> &mut u64 {
11011 self.version.get_or_insert_default()
11012 }
11013 pub fn version_opt(&self) -> Option<u64> {
11015 self.version.as_ref().map(|field| *field)
11016 }
11017 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
11019 self.version = Some(field.into().into());
11020 }
11021 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
11023 self.set_version(field.into());
11024 self
11025 }
11026 pub fn modules(&self) -> &[super::Module] {
11028 &self.modules
11029 }
11030 pub fn modules_mut(&mut self) -> &mut Vec<super::Module> {
11033 &mut self.modules
11034 }
11035 pub fn set_modules(&mut self, field: Vec<super::Module>) {
11037 self.modules = field;
11038 }
11039 pub fn with_modules(mut self, field: Vec<super::Module>) -> Self {
11041 self.set_modules(field);
11042 self
11043 }
11044 pub fn type_origins(&self) -> &[super::TypeOrigin] {
11046 &self.type_origins
11047 }
11048 pub fn type_origins_mut(&mut self) -> &mut Vec<super::TypeOrigin> {
11051 &mut self.type_origins
11052 }
11053 pub fn set_type_origins(&mut self, field: Vec<super::TypeOrigin>) {
11055 self.type_origins = field;
11056 }
11057 pub fn with_type_origins(mut self, field: Vec<super::TypeOrigin>) -> Self {
11059 self.set_type_origins(field);
11060 self
11061 }
11062 pub fn linkage(&self) -> &[super::Linkage] {
11064 &self.linkage
11065 }
11066 pub fn linkage_mut(&mut self) -> &mut Vec<super::Linkage> {
11069 &mut self.linkage
11070 }
11071 pub fn set_linkage(&mut self, field: Vec<super::Linkage>) {
11073 self.linkage = field;
11074 }
11075 pub fn with_linkage(mut self, field: Vec<super::Linkage>) -> Self {
11077 self.set_linkage(field);
11078 self
11079 }
11080 }
11081 impl super::PackageUpgradeError {
11082 pub const fn const_default() -> Self {
11083 Self {
11084 kind: None,
11085 package_id: None,
11086 digest: None,
11087 policy: None,
11088 ticket_id: None,
11089 }
11090 }
11091 #[doc(hidden)]
11092 pub fn default_instance() -> &'static Self {
11093 static DEFAULT: super::PackageUpgradeError = super::PackageUpgradeError::const_default();
11094 &DEFAULT
11095 }
11096 pub fn with_kind<T: Into<super::package_upgrade_error::PackageUpgradeErrorKind>>(
11098 mut self,
11099 field: T,
11100 ) -> Self {
11101 self.set_kind(field.into());
11102 self
11103 }
11104 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
11106 self.package_id.as_mut().map(|field| field as _)
11107 }
11108 pub fn package_id_mut(&mut self) -> &mut String {
11111 self.package_id.get_or_insert_default()
11112 }
11113 pub fn package_id_opt(&self) -> Option<&str> {
11115 self.package_id.as_ref().map(|field| field as _)
11116 }
11117 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
11119 self.package_id = Some(field.into().into());
11120 }
11121 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
11123 self.set_package_id(field.into());
11124 self
11125 }
11126 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
11128 self.digest.as_mut().map(|field| field as _)
11129 }
11130 pub fn digest_mut(&mut self) -> &mut String {
11133 self.digest.get_or_insert_default()
11134 }
11135 pub fn digest_opt(&self) -> Option<&str> {
11137 self.digest.as_ref().map(|field| field as _)
11138 }
11139 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
11141 self.digest = Some(field.into().into());
11142 }
11143 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
11145 self.set_digest(field.into());
11146 self
11147 }
11148 pub fn policy_opt_mut(&mut self) -> Option<&mut u32> {
11150 self.policy.as_mut().map(|field| field as _)
11151 }
11152 pub fn policy_mut(&mut self) -> &mut u32 {
11155 self.policy.get_or_insert_default()
11156 }
11157 pub fn policy_opt(&self) -> Option<u32> {
11159 self.policy.as_ref().map(|field| *field)
11160 }
11161 pub fn set_policy<T: Into<u32>>(&mut self, field: T) {
11163 self.policy = Some(field.into().into());
11164 }
11165 pub fn with_policy<T: Into<u32>>(mut self, field: T) -> Self {
11167 self.set_policy(field.into());
11168 self
11169 }
11170 pub fn ticket_id_opt_mut(&mut self) -> Option<&mut String> {
11172 self.ticket_id.as_mut().map(|field| field as _)
11173 }
11174 pub fn ticket_id_mut(&mut self) -> &mut String {
11177 self.ticket_id.get_or_insert_default()
11178 }
11179 pub fn ticket_id_opt(&self) -> Option<&str> {
11181 self.ticket_id.as_ref().map(|field| field as _)
11182 }
11183 pub fn set_ticket_id<T: Into<String>>(&mut self, field: T) {
11185 self.ticket_id = Some(field.into().into());
11186 }
11187 pub fn with_ticket_id<T: Into<String>>(mut self, field: T) -> Self {
11189 self.set_ticket_id(field.into());
11190 self
11191 }
11192 }
11193 impl super::PackageVersion {
11194 pub const fn const_default() -> Self {
11195 Self {
11196 package_id: None,
11197 version: None,
11198 }
11199 }
11200 #[doc(hidden)]
11201 pub fn default_instance() -> &'static Self {
11202 static DEFAULT: super::PackageVersion = super::PackageVersion::const_default();
11203 &DEFAULT
11204 }
11205 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
11207 self.package_id.as_mut().map(|field| field as _)
11208 }
11209 pub fn package_id_mut(&mut self) -> &mut String {
11212 self.package_id.get_or_insert_default()
11213 }
11214 pub fn package_id_opt(&self) -> Option<&str> {
11216 self.package_id.as_ref().map(|field| field as _)
11217 }
11218 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
11220 self.package_id = Some(field.into().into());
11221 }
11222 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
11224 self.set_package_id(field.into());
11225 self
11226 }
11227 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
11229 self.version.as_mut().map(|field| field as _)
11230 }
11231 pub fn version_mut(&mut self) -> &mut u64 {
11234 self.version.get_or_insert_default()
11235 }
11236 pub fn version_opt(&self) -> Option<u64> {
11238 self.version.as_ref().map(|field| *field)
11239 }
11240 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
11242 self.version = Some(field.into().into());
11243 }
11244 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
11246 self.set_version(field.into());
11247 self
11248 }
11249 }
11250 impl super::PasskeyAuthenticator {
11251 pub const fn const_default() -> Self {
11252 Self {
11253 authenticator_data: None,
11254 client_data_json: None,
11255 signature: None,
11256 }
11257 }
11258 #[doc(hidden)]
11259 pub fn default_instance() -> &'static Self {
11260 static DEFAULT: super::PasskeyAuthenticator = super::PasskeyAuthenticator::const_default();
11261 &DEFAULT
11262 }
11263 pub fn authenticator_data_opt(&self) -> Option<&[u8]> {
11265 self.authenticator_data.as_ref().map(|field| field as _)
11266 }
11267 pub fn set_authenticator_data<T: Into<::prost::bytes::Bytes>>(
11269 &mut self,
11270 field: T,
11271 ) {
11272 self.authenticator_data = Some(field.into().into());
11273 }
11274 pub fn with_authenticator_data<T: Into<::prost::bytes::Bytes>>(
11276 mut self,
11277 field: T,
11278 ) -> Self {
11279 self.set_authenticator_data(field.into());
11280 self
11281 }
11282 pub fn client_data_json_opt_mut(&mut self) -> Option<&mut String> {
11284 self.client_data_json.as_mut().map(|field| field as _)
11285 }
11286 pub fn client_data_json_mut(&mut self) -> &mut String {
11289 self.client_data_json.get_or_insert_default()
11290 }
11291 pub fn client_data_json_opt(&self) -> Option<&str> {
11293 self.client_data_json.as_ref().map(|field| field as _)
11294 }
11295 pub fn set_client_data_json<T: Into<String>>(&mut self, field: T) {
11297 self.client_data_json = Some(field.into().into());
11298 }
11299 pub fn with_client_data_json<T: Into<String>>(mut self, field: T) -> Self {
11301 self.set_client_data_json(field.into());
11302 self
11303 }
11304 pub fn signature(&self) -> &super::SimpleSignature {
11306 self.signature
11307 .as_ref()
11308 .map(|field| field as _)
11309 .unwrap_or_else(|| super::SimpleSignature::default_instance() as _)
11310 }
11311 pub fn signature_opt_mut(&mut self) -> Option<&mut super::SimpleSignature> {
11313 self.signature.as_mut().map(|field| field as _)
11314 }
11315 pub fn signature_mut(&mut self) -> &mut super::SimpleSignature {
11318 self.signature.get_or_insert_default()
11319 }
11320 pub fn signature_opt(&self) -> Option<&super::SimpleSignature> {
11322 self.signature.as_ref().map(|field| field as _)
11323 }
11324 pub fn set_signature<T: Into<super::SimpleSignature>>(&mut self, field: T) {
11326 self.signature = Some(field.into().into());
11327 }
11328 pub fn with_signature<T: Into<super::SimpleSignature>>(
11330 mut self,
11331 field: T,
11332 ) -> Self {
11333 self.set_signature(field.into());
11334 self
11335 }
11336 }
11337 impl super::ProgrammableTransaction {
11338 pub const fn const_default() -> Self {
11339 Self {
11340 inputs: Vec::new(),
11341 commands: Vec::new(),
11342 }
11343 }
11344 #[doc(hidden)]
11345 pub fn default_instance() -> &'static Self {
11346 static DEFAULT: super::ProgrammableTransaction = super::ProgrammableTransaction::const_default();
11347 &DEFAULT
11348 }
11349 pub fn inputs(&self) -> &[super::Input] {
11351 &self.inputs
11352 }
11353 pub fn inputs_mut(&mut self) -> &mut Vec<super::Input> {
11356 &mut self.inputs
11357 }
11358 pub fn set_inputs(&mut self, field: Vec<super::Input>) {
11360 self.inputs = field;
11361 }
11362 pub fn with_inputs(mut self, field: Vec<super::Input>) -> Self {
11364 self.set_inputs(field);
11365 self
11366 }
11367 pub fn commands(&self) -> &[super::Command] {
11369 &self.commands
11370 }
11371 pub fn commands_mut(&mut self) -> &mut Vec<super::Command> {
11374 &mut self.commands
11375 }
11376 pub fn set_commands(&mut self, field: Vec<super::Command>) {
11378 self.commands = field;
11379 }
11380 pub fn with_commands(mut self, field: Vec<super::Command>) -> Self {
11382 self.set_commands(field);
11383 self
11384 }
11385 }
11386 impl super::ProtocolConfig {
11387 pub const fn const_default() -> Self {
11388 Self {
11389 protocol_version: None,
11390 feature_flags: std::collections::BTreeMap::new(),
11391 attributes: std::collections::BTreeMap::new(),
11392 }
11393 }
11394 #[doc(hidden)]
11395 pub fn default_instance() -> &'static Self {
11396 static DEFAULT: super::ProtocolConfig = super::ProtocolConfig::const_default();
11397 &DEFAULT
11398 }
11399 pub fn protocol_version_opt_mut(&mut self) -> Option<&mut u64> {
11401 self.protocol_version.as_mut().map(|field| field as _)
11402 }
11403 pub fn protocol_version_mut(&mut self) -> &mut u64 {
11406 self.protocol_version.get_or_insert_default()
11407 }
11408 pub fn protocol_version_opt(&self) -> Option<u64> {
11410 self.protocol_version.as_ref().map(|field| *field)
11411 }
11412 pub fn set_protocol_version<T: Into<u64>>(&mut self, field: T) {
11414 self.protocol_version = Some(field.into().into());
11415 }
11416 pub fn with_protocol_version<T: Into<u64>>(mut self, field: T) -> Self {
11418 self.set_protocol_version(field.into());
11419 self
11420 }
11421 pub fn feature_flags(&self) -> &::std::collections::BTreeMap<String, bool> {
11423 &self.feature_flags
11424 }
11425 pub fn feature_flags_mut(
11428 &mut self,
11429 ) -> &mut ::std::collections::BTreeMap<String, bool> {
11430 &mut self.feature_flags
11431 }
11432 pub fn set_feature_flags(
11434 &mut self,
11435 field: ::std::collections::BTreeMap<String, bool>,
11436 ) {
11437 self.feature_flags = field;
11438 }
11439 pub fn with_feature_flags(
11441 mut self,
11442 field: ::std::collections::BTreeMap<String, bool>,
11443 ) -> Self {
11444 self.set_feature_flags(field);
11445 self
11446 }
11447 pub fn attributes(&self) -> &::std::collections::BTreeMap<String, String> {
11449 &self.attributes
11450 }
11451 pub fn attributes_mut(
11454 &mut self,
11455 ) -> &mut ::std::collections::BTreeMap<String, String> {
11456 &mut self.attributes
11457 }
11458 pub fn set_attributes(
11460 &mut self,
11461 field: ::std::collections::BTreeMap<String, String>,
11462 ) {
11463 self.attributes = field;
11464 }
11465 pub fn with_attributes(
11467 mut self,
11468 field: ::std::collections::BTreeMap<String, String>,
11469 ) -> Self {
11470 self.set_attributes(field);
11471 self
11472 }
11473 }
11474 impl super::Publish {
11475 pub const fn const_default() -> Self {
11476 Self {
11477 modules: Vec::new(),
11478 dependencies: Vec::new(),
11479 }
11480 }
11481 #[doc(hidden)]
11482 pub fn default_instance() -> &'static Self {
11483 static DEFAULT: super::Publish = super::Publish::const_default();
11484 &DEFAULT
11485 }
11486 pub fn modules(&self) -> &[::prost::bytes::Bytes] {
11488 &self.modules
11489 }
11490 pub fn modules_mut(&mut self) -> &mut Vec<::prost::bytes::Bytes> {
11493 &mut self.modules
11494 }
11495 pub fn set_modules(&mut self, field: Vec<::prost::bytes::Bytes>) {
11497 self.modules = field;
11498 }
11499 pub fn with_modules(mut self, field: Vec<::prost::bytes::Bytes>) -> Self {
11501 self.set_modules(field);
11502 self
11503 }
11504 pub fn dependencies(&self) -> &[String] {
11506 &self.dependencies
11507 }
11508 pub fn dependencies_mut(&mut self) -> &mut Vec<String> {
11511 &mut self.dependencies
11512 }
11513 pub fn set_dependencies(&mut self, field: Vec<String>) {
11515 self.dependencies = field;
11516 }
11517 pub fn with_dependencies(mut self, field: Vec<String>) -> Self {
11519 self.set_dependencies(field);
11520 self
11521 }
11522 }
11523 impl super::RandomnessStateUpdate {
11524 pub const fn const_default() -> Self {
11525 Self {
11526 epoch: None,
11527 randomness_round: None,
11528 random_bytes: None,
11529 randomness_object_initial_shared_version: None,
11530 }
11531 }
11532 #[doc(hidden)]
11533 pub fn default_instance() -> &'static Self {
11534 static DEFAULT: super::RandomnessStateUpdate = super::RandomnessStateUpdate::const_default();
11535 &DEFAULT
11536 }
11537 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
11539 self.epoch.as_mut().map(|field| field as _)
11540 }
11541 pub fn epoch_mut(&mut self) -> &mut u64 {
11544 self.epoch.get_or_insert_default()
11545 }
11546 pub fn epoch_opt(&self) -> Option<u64> {
11548 self.epoch.as_ref().map(|field| *field)
11549 }
11550 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
11552 self.epoch = Some(field.into().into());
11553 }
11554 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
11556 self.set_epoch(field.into());
11557 self
11558 }
11559 pub fn randomness_round_opt_mut(&mut self) -> Option<&mut u64> {
11561 self.randomness_round.as_mut().map(|field| field as _)
11562 }
11563 pub fn randomness_round_mut(&mut self) -> &mut u64 {
11566 self.randomness_round.get_or_insert_default()
11567 }
11568 pub fn randomness_round_opt(&self) -> Option<u64> {
11570 self.randomness_round.as_ref().map(|field| *field)
11571 }
11572 pub fn set_randomness_round<T: Into<u64>>(&mut self, field: T) {
11574 self.randomness_round = Some(field.into().into());
11575 }
11576 pub fn with_randomness_round<T: Into<u64>>(mut self, field: T) -> Self {
11578 self.set_randomness_round(field.into());
11579 self
11580 }
11581 pub fn random_bytes_opt(&self) -> Option<&[u8]> {
11583 self.random_bytes.as_ref().map(|field| field as _)
11584 }
11585 pub fn set_random_bytes<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
11587 self.random_bytes = Some(field.into().into());
11588 }
11589 pub fn with_random_bytes<T: Into<::prost::bytes::Bytes>>(
11591 mut self,
11592 field: T,
11593 ) -> Self {
11594 self.set_random_bytes(field.into());
11595 self
11596 }
11597 pub fn randomness_object_initial_shared_version_opt_mut(
11599 &mut self,
11600 ) -> Option<&mut u64> {
11601 self.randomness_object_initial_shared_version
11602 .as_mut()
11603 .map(|field| field as _)
11604 }
11605 pub fn randomness_object_initial_shared_version_mut(&mut self) -> &mut u64 {
11608 self.randomness_object_initial_shared_version.get_or_insert_default()
11609 }
11610 pub fn randomness_object_initial_shared_version_opt(&self) -> Option<u64> {
11612 self.randomness_object_initial_shared_version.as_ref().map(|field| *field)
11613 }
11614 pub fn set_randomness_object_initial_shared_version<T: Into<u64>>(
11616 &mut self,
11617 field: T,
11618 ) {
11619 self.randomness_object_initial_shared_version = Some(field.into().into());
11620 }
11621 pub fn with_randomness_object_initial_shared_version<T: Into<u64>>(
11623 mut self,
11624 field: T,
11625 ) -> Self {
11626 self.set_randomness_object_initial_shared_version(field.into());
11627 self
11628 }
11629 }
11630 impl super::RegulatedCoinMetadata {
11631 pub const fn const_default() -> Self {
11632 Self {
11633 id: None,
11634 coin_metadata_object: None,
11635 deny_cap_object: None,
11636 allow_global_pause: None,
11637 variant: None,
11638 coin_regulated_state: None,
11639 }
11640 }
11641 #[doc(hidden)]
11642 pub fn default_instance() -> &'static Self {
11643 static DEFAULT: super::RegulatedCoinMetadata = super::RegulatedCoinMetadata::const_default();
11644 &DEFAULT
11645 }
11646 pub fn id_opt_mut(&mut self) -> Option<&mut String> {
11648 self.id.as_mut().map(|field| field as _)
11649 }
11650 pub fn id_mut(&mut self) -> &mut String {
11653 self.id.get_or_insert_default()
11654 }
11655 pub fn id_opt(&self) -> Option<&str> {
11657 self.id.as_ref().map(|field| field as _)
11658 }
11659 pub fn set_id<T: Into<String>>(&mut self, field: T) {
11661 self.id = Some(field.into().into());
11662 }
11663 pub fn with_id<T: Into<String>>(mut self, field: T) -> Self {
11665 self.set_id(field.into());
11666 self
11667 }
11668 pub fn coin_metadata_object_opt_mut(&mut self) -> Option<&mut String> {
11670 self.coin_metadata_object.as_mut().map(|field| field as _)
11671 }
11672 pub fn coin_metadata_object_mut(&mut self) -> &mut String {
11675 self.coin_metadata_object.get_or_insert_default()
11676 }
11677 pub fn coin_metadata_object_opt(&self) -> Option<&str> {
11679 self.coin_metadata_object.as_ref().map(|field| field as _)
11680 }
11681 pub fn set_coin_metadata_object<T: Into<String>>(&mut self, field: T) {
11683 self.coin_metadata_object = Some(field.into().into());
11684 }
11685 pub fn with_coin_metadata_object<T: Into<String>>(mut self, field: T) -> Self {
11687 self.set_coin_metadata_object(field.into());
11688 self
11689 }
11690 pub fn deny_cap_object_opt_mut(&mut self) -> Option<&mut String> {
11692 self.deny_cap_object.as_mut().map(|field| field as _)
11693 }
11694 pub fn deny_cap_object_mut(&mut self) -> &mut String {
11697 self.deny_cap_object.get_or_insert_default()
11698 }
11699 pub fn deny_cap_object_opt(&self) -> Option<&str> {
11701 self.deny_cap_object.as_ref().map(|field| field as _)
11702 }
11703 pub fn set_deny_cap_object<T: Into<String>>(&mut self, field: T) {
11705 self.deny_cap_object = Some(field.into().into());
11706 }
11707 pub fn with_deny_cap_object<T: Into<String>>(mut self, field: T) -> Self {
11709 self.set_deny_cap_object(field.into());
11710 self
11711 }
11712 pub fn allow_global_pause_opt_mut(&mut self) -> Option<&mut bool> {
11714 self.allow_global_pause.as_mut().map(|field| field as _)
11715 }
11716 pub fn allow_global_pause_mut(&mut self) -> &mut bool {
11719 self.allow_global_pause.get_or_insert_default()
11720 }
11721 pub fn allow_global_pause_opt(&self) -> Option<bool> {
11723 self.allow_global_pause.as_ref().map(|field| *field)
11724 }
11725 pub fn set_allow_global_pause<T: Into<bool>>(&mut self, field: T) {
11727 self.allow_global_pause = Some(field.into().into());
11728 }
11729 pub fn with_allow_global_pause<T: Into<bool>>(mut self, field: T) -> Self {
11731 self.set_allow_global_pause(field.into());
11732 self
11733 }
11734 pub fn variant_opt_mut(&mut self) -> Option<&mut u32> {
11736 self.variant.as_mut().map(|field| field as _)
11737 }
11738 pub fn variant_mut(&mut self) -> &mut u32 {
11741 self.variant.get_or_insert_default()
11742 }
11743 pub fn variant_opt(&self) -> Option<u32> {
11745 self.variant.as_ref().map(|field| *field)
11746 }
11747 pub fn set_variant<T: Into<u32>>(&mut self, field: T) {
11749 self.variant = Some(field.into().into());
11750 }
11751 pub fn with_variant<T: Into<u32>>(mut self, field: T) -> Self {
11753 self.set_variant(field.into());
11754 self
11755 }
11756 pub fn with_coin_regulated_state<
11758 T: Into<super::regulated_coin_metadata::CoinRegulatedState>,
11759 >(mut self, field: T) -> Self {
11760 self.set_coin_regulated_state(field.into());
11761 self
11762 }
11763 }
11764 impl super::ReverseLookupNameRequest {
11765 pub const fn const_default() -> Self {
11766 Self { address: None }
11767 }
11768 #[doc(hidden)]
11769 pub fn default_instance() -> &'static Self {
11770 static DEFAULT: super::ReverseLookupNameRequest = super::ReverseLookupNameRequest::const_default();
11771 &DEFAULT
11772 }
11773 pub fn address_opt_mut(&mut self) -> Option<&mut String> {
11775 self.address.as_mut().map(|field| field as _)
11776 }
11777 pub fn address_mut(&mut self) -> &mut String {
11780 self.address.get_or_insert_default()
11781 }
11782 pub fn address_opt(&self) -> Option<&str> {
11784 self.address.as_ref().map(|field| field as _)
11785 }
11786 pub fn set_address<T: Into<String>>(&mut self, field: T) {
11788 self.address = Some(field.into().into());
11789 }
11790 pub fn with_address<T: Into<String>>(mut self, field: T) -> Self {
11792 self.set_address(field.into());
11793 self
11794 }
11795 }
11796 impl super::ReverseLookupNameResponse {
11797 pub const fn const_default() -> Self {
11798 Self { record: None }
11799 }
11800 #[doc(hidden)]
11801 pub fn default_instance() -> &'static Self {
11802 static DEFAULT: super::ReverseLookupNameResponse = super::ReverseLookupNameResponse::const_default();
11803 &DEFAULT
11804 }
11805 pub fn record(&self) -> &super::NameRecord {
11807 self.record
11808 .as_ref()
11809 .map(|field| field as _)
11810 .unwrap_or_else(|| super::NameRecord::default_instance() as _)
11811 }
11812 pub fn record_opt_mut(&mut self) -> Option<&mut super::NameRecord> {
11814 self.record.as_mut().map(|field| field as _)
11815 }
11816 pub fn record_mut(&mut self) -> &mut super::NameRecord {
11819 self.record.get_or_insert_default()
11820 }
11821 pub fn record_opt(&self) -> Option<&super::NameRecord> {
11823 self.record.as_ref().map(|field| field as _)
11824 }
11825 pub fn set_record<T: Into<super::NameRecord>>(&mut self, field: T) {
11827 self.record = Some(field.into().into());
11828 }
11829 pub fn with_record<T: Into<super::NameRecord>>(mut self, field: T) -> Self {
11831 self.set_record(field.into());
11832 self
11833 }
11834 }
11835 impl super::SimpleSignature {
11836 pub const fn const_default() -> Self {
11837 Self {
11838 scheme: None,
11839 signature: None,
11840 public_key: None,
11841 }
11842 }
11843 #[doc(hidden)]
11844 pub fn default_instance() -> &'static Self {
11845 static DEFAULT: super::SimpleSignature = super::SimpleSignature::const_default();
11846 &DEFAULT
11847 }
11848 pub fn with_scheme<T: Into<super::SignatureScheme>>(mut self, field: T) -> Self {
11850 self.set_scheme(field.into());
11851 self
11852 }
11853 pub fn signature_opt(&self) -> Option<&[u8]> {
11855 self.signature.as_ref().map(|field| field as _)
11856 }
11857 pub fn set_signature<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
11859 self.signature = Some(field.into().into());
11860 }
11861 pub fn with_signature<T: Into<::prost::bytes::Bytes>>(
11863 mut self,
11864 field: T,
11865 ) -> Self {
11866 self.set_signature(field.into());
11867 self
11868 }
11869 pub fn public_key_opt(&self) -> Option<&[u8]> {
11871 self.public_key.as_ref().map(|field| field as _)
11872 }
11873 pub fn set_public_key<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
11875 self.public_key = Some(field.into().into());
11876 }
11877 pub fn with_public_key<T: Into<::prost::bytes::Bytes>>(
11879 mut self,
11880 field: T,
11881 ) -> Self {
11882 self.set_public_key(field.into());
11883 self
11884 }
11885 }
11886 impl super::SimulateTransactionRequest {
11887 pub const fn const_default() -> Self {
11888 Self {
11889 transaction: None,
11890 read_mask: None,
11891 checks: None,
11892 do_gas_selection: None,
11893 }
11894 }
11895 #[doc(hidden)]
11896 pub fn default_instance() -> &'static Self {
11897 static DEFAULT: super::SimulateTransactionRequest = super::SimulateTransactionRequest::const_default();
11898 &DEFAULT
11899 }
11900 pub fn transaction(&self) -> &super::Transaction {
11902 self.transaction
11903 .as_ref()
11904 .map(|field| field as _)
11905 .unwrap_or_else(|| super::Transaction::default_instance() as _)
11906 }
11907 pub fn transaction_opt_mut(&mut self) -> Option<&mut super::Transaction> {
11909 self.transaction.as_mut().map(|field| field as _)
11910 }
11911 pub fn transaction_mut(&mut self) -> &mut super::Transaction {
11914 self.transaction.get_or_insert_default()
11915 }
11916 pub fn transaction_opt(&self) -> Option<&super::Transaction> {
11918 self.transaction.as_ref().map(|field| field as _)
11919 }
11920 pub fn set_transaction<T: Into<super::Transaction>>(&mut self, field: T) {
11922 self.transaction = Some(field.into().into());
11923 }
11924 pub fn with_transaction<T: Into<super::Transaction>>(
11926 mut self,
11927 field: T,
11928 ) -> Self {
11929 self.set_transaction(field.into());
11930 self
11931 }
11932 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
11934 self.read_mask.as_mut().map(|field| field as _)
11935 }
11936 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
11939 self.read_mask.get_or_insert_default()
11940 }
11941 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
11943 self.read_mask.as_ref().map(|field| field as _)
11944 }
11945 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
11947 self.read_mask = Some(field.into().into());
11948 }
11949 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
11951 mut self,
11952 field: T,
11953 ) -> Self {
11954 self.set_read_mask(field.into());
11955 self
11956 }
11957 pub fn with_checks<
11959 T: Into<super::simulate_transaction_request::TransactionChecks>,
11960 >(mut self, field: T) -> Self {
11961 self.set_checks(field.into());
11962 self
11963 }
11964 pub fn do_gas_selection_opt_mut(&mut self) -> Option<&mut bool> {
11966 self.do_gas_selection.as_mut().map(|field| field as _)
11967 }
11968 pub fn do_gas_selection_mut(&mut self) -> &mut bool {
11971 self.do_gas_selection.get_or_insert_default()
11972 }
11973 pub fn do_gas_selection_opt(&self) -> Option<bool> {
11975 self.do_gas_selection.as_ref().map(|field| *field)
11976 }
11977 pub fn set_do_gas_selection<T: Into<bool>>(&mut self, field: T) {
11979 self.do_gas_selection = Some(field.into().into());
11980 }
11981 pub fn with_do_gas_selection<T: Into<bool>>(mut self, field: T) -> Self {
11983 self.set_do_gas_selection(field.into());
11984 self
11985 }
11986 }
11987 impl super::SimulateTransactionResponse {
11988 pub const fn const_default() -> Self {
11989 Self {
11990 transaction: None,
11991 outputs: Vec::new(),
11992 }
11993 }
11994 #[doc(hidden)]
11995 pub fn default_instance() -> &'static Self {
11996 static DEFAULT: super::SimulateTransactionResponse = super::SimulateTransactionResponse::const_default();
11997 &DEFAULT
11998 }
11999 pub fn transaction(&self) -> &super::ExecutedTransaction {
12001 self.transaction
12002 .as_ref()
12003 .map(|field| field as _)
12004 .unwrap_or_else(|| super::ExecutedTransaction::default_instance() as _)
12005 }
12006 pub fn transaction_opt_mut(
12008 &mut self,
12009 ) -> Option<&mut super::ExecutedTransaction> {
12010 self.transaction.as_mut().map(|field| field as _)
12011 }
12012 pub fn transaction_mut(&mut self) -> &mut super::ExecutedTransaction {
12015 self.transaction.get_or_insert_default()
12016 }
12017 pub fn transaction_opt(&self) -> Option<&super::ExecutedTransaction> {
12019 self.transaction.as_ref().map(|field| field as _)
12020 }
12021 pub fn set_transaction<T: Into<super::ExecutedTransaction>>(
12023 &mut self,
12024 field: T,
12025 ) {
12026 self.transaction = Some(field.into().into());
12027 }
12028 pub fn with_transaction<T: Into<super::ExecutedTransaction>>(
12030 mut self,
12031 field: T,
12032 ) -> Self {
12033 self.set_transaction(field.into());
12034 self
12035 }
12036 pub fn outputs(&self) -> &[super::CommandResult] {
12038 &self.outputs
12039 }
12040 pub fn outputs_mut(&mut self) -> &mut Vec<super::CommandResult> {
12043 &mut self.outputs
12044 }
12045 pub fn set_outputs(&mut self, field: Vec<super::CommandResult>) {
12047 self.outputs = field;
12048 }
12049 pub fn with_outputs(mut self, field: Vec<super::CommandResult>) -> Self {
12051 self.set_outputs(field);
12052 self
12053 }
12054 }
12055 impl super::SizeError {
12056 pub const fn const_default() -> Self {
12057 Self { size: None, max_size: None }
12058 }
12059 #[doc(hidden)]
12060 pub fn default_instance() -> &'static Self {
12061 static DEFAULT: super::SizeError = super::SizeError::const_default();
12062 &DEFAULT
12063 }
12064 pub fn size_opt_mut(&mut self) -> Option<&mut u64> {
12066 self.size.as_mut().map(|field| field as _)
12067 }
12068 pub fn size_mut(&mut self) -> &mut u64 {
12071 self.size.get_or_insert_default()
12072 }
12073 pub fn size_opt(&self) -> Option<u64> {
12075 self.size.as_ref().map(|field| *field)
12076 }
12077 pub fn set_size<T: Into<u64>>(&mut self, field: T) {
12079 self.size = Some(field.into().into());
12080 }
12081 pub fn with_size<T: Into<u64>>(mut self, field: T) -> Self {
12083 self.set_size(field.into());
12084 self
12085 }
12086 pub fn max_size_opt_mut(&mut self) -> Option<&mut u64> {
12088 self.max_size.as_mut().map(|field| field as _)
12089 }
12090 pub fn max_size_mut(&mut self) -> &mut u64 {
12093 self.max_size.get_or_insert_default()
12094 }
12095 pub fn max_size_opt(&self) -> Option<u64> {
12097 self.max_size.as_ref().map(|field| *field)
12098 }
12099 pub fn set_max_size<T: Into<u64>>(&mut self, field: T) {
12101 self.max_size = Some(field.into().into());
12102 }
12103 pub fn with_max_size<T: Into<u64>>(mut self, field: T) -> Self {
12105 self.set_max_size(field.into());
12106 self
12107 }
12108 }
12109 impl super::SplitCoins {
12110 pub const fn const_default() -> Self {
12111 Self {
12112 coin: None,
12113 amounts: Vec::new(),
12114 }
12115 }
12116 #[doc(hidden)]
12117 pub fn default_instance() -> &'static Self {
12118 static DEFAULT: super::SplitCoins = super::SplitCoins::const_default();
12119 &DEFAULT
12120 }
12121 pub fn coin(&self) -> &super::Argument {
12123 self.coin
12124 .as_ref()
12125 .map(|field| field as _)
12126 .unwrap_or_else(|| super::Argument::default_instance() as _)
12127 }
12128 pub fn coin_opt_mut(&mut self) -> Option<&mut super::Argument> {
12130 self.coin.as_mut().map(|field| field as _)
12131 }
12132 pub fn coin_mut(&mut self) -> &mut super::Argument {
12135 self.coin.get_or_insert_default()
12136 }
12137 pub fn coin_opt(&self) -> Option<&super::Argument> {
12139 self.coin.as_ref().map(|field| field as _)
12140 }
12141 pub fn set_coin<T: Into<super::Argument>>(&mut self, field: T) {
12143 self.coin = Some(field.into().into());
12144 }
12145 pub fn with_coin<T: Into<super::Argument>>(mut self, field: T) -> Self {
12147 self.set_coin(field.into());
12148 self
12149 }
12150 pub fn amounts(&self) -> &[super::Argument] {
12152 &self.amounts
12153 }
12154 pub fn amounts_mut(&mut self) -> &mut Vec<super::Argument> {
12157 &mut self.amounts
12158 }
12159 pub fn set_amounts(&mut self, field: Vec<super::Argument>) {
12161 self.amounts = field;
12162 }
12163 pub fn with_amounts(mut self, field: Vec<super::Argument>) -> Self {
12165 self.set_amounts(field);
12166 self
12167 }
12168 }
12169 impl super::StakeSubsidy {
12170 pub const fn const_default() -> Self {
12171 Self {
12172 balance: None,
12173 distribution_counter: None,
12174 current_distribution_amount: None,
12175 stake_subsidy_period_length: None,
12176 stake_subsidy_decrease_rate: None,
12177 extra_fields: None,
12178 }
12179 }
12180 #[doc(hidden)]
12181 pub fn default_instance() -> &'static Self {
12182 static DEFAULT: super::StakeSubsidy = super::StakeSubsidy::const_default();
12183 &DEFAULT
12184 }
12185 pub fn balance_opt_mut(&mut self) -> Option<&mut u64> {
12187 self.balance.as_mut().map(|field| field as _)
12188 }
12189 pub fn balance_mut(&mut self) -> &mut u64 {
12192 self.balance.get_or_insert_default()
12193 }
12194 pub fn balance_opt(&self) -> Option<u64> {
12196 self.balance.as_ref().map(|field| *field)
12197 }
12198 pub fn set_balance<T: Into<u64>>(&mut self, field: T) {
12200 self.balance = Some(field.into().into());
12201 }
12202 pub fn with_balance<T: Into<u64>>(mut self, field: T) -> Self {
12204 self.set_balance(field.into());
12205 self
12206 }
12207 pub fn distribution_counter_opt_mut(&mut self) -> Option<&mut u64> {
12209 self.distribution_counter.as_mut().map(|field| field as _)
12210 }
12211 pub fn distribution_counter_mut(&mut self) -> &mut u64 {
12214 self.distribution_counter.get_or_insert_default()
12215 }
12216 pub fn distribution_counter_opt(&self) -> Option<u64> {
12218 self.distribution_counter.as_ref().map(|field| *field)
12219 }
12220 pub fn set_distribution_counter<T: Into<u64>>(&mut self, field: T) {
12222 self.distribution_counter = Some(field.into().into());
12223 }
12224 pub fn with_distribution_counter<T: Into<u64>>(mut self, field: T) -> Self {
12226 self.set_distribution_counter(field.into());
12227 self
12228 }
12229 pub fn current_distribution_amount_opt_mut(&mut self) -> Option<&mut u64> {
12231 self.current_distribution_amount.as_mut().map(|field| field as _)
12232 }
12233 pub fn current_distribution_amount_mut(&mut self) -> &mut u64 {
12236 self.current_distribution_amount.get_or_insert_default()
12237 }
12238 pub fn current_distribution_amount_opt(&self) -> Option<u64> {
12240 self.current_distribution_amount.as_ref().map(|field| *field)
12241 }
12242 pub fn set_current_distribution_amount<T: Into<u64>>(&mut self, field: T) {
12244 self.current_distribution_amount = Some(field.into().into());
12245 }
12246 pub fn with_current_distribution_amount<T: Into<u64>>(
12248 mut self,
12249 field: T,
12250 ) -> Self {
12251 self.set_current_distribution_amount(field.into());
12252 self
12253 }
12254 pub fn stake_subsidy_period_length_opt_mut(&mut self) -> Option<&mut u64> {
12256 self.stake_subsidy_period_length.as_mut().map(|field| field as _)
12257 }
12258 pub fn stake_subsidy_period_length_mut(&mut self) -> &mut u64 {
12261 self.stake_subsidy_period_length.get_or_insert_default()
12262 }
12263 pub fn stake_subsidy_period_length_opt(&self) -> Option<u64> {
12265 self.stake_subsidy_period_length.as_ref().map(|field| *field)
12266 }
12267 pub fn set_stake_subsidy_period_length<T: Into<u64>>(&mut self, field: T) {
12269 self.stake_subsidy_period_length = Some(field.into().into());
12270 }
12271 pub fn with_stake_subsidy_period_length<T: Into<u64>>(
12273 mut self,
12274 field: T,
12275 ) -> Self {
12276 self.set_stake_subsidy_period_length(field.into());
12277 self
12278 }
12279 pub fn stake_subsidy_decrease_rate_opt_mut(&mut self) -> Option<&mut u32> {
12281 self.stake_subsidy_decrease_rate.as_mut().map(|field| field as _)
12282 }
12283 pub fn stake_subsidy_decrease_rate_mut(&mut self) -> &mut u32 {
12286 self.stake_subsidy_decrease_rate.get_or_insert_default()
12287 }
12288 pub fn stake_subsidy_decrease_rate_opt(&self) -> Option<u32> {
12290 self.stake_subsidy_decrease_rate.as_ref().map(|field| *field)
12291 }
12292 pub fn set_stake_subsidy_decrease_rate<T: Into<u32>>(&mut self, field: T) {
12294 self.stake_subsidy_decrease_rate = Some(field.into().into());
12295 }
12296 pub fn with_stake_subsidy_decrease_rate<T: Into<u32>>(
12298 mut self,
12299 field: T,
12300 ) -> Self {
12301 self.set_stake_subsidy_decrease_rate(field.into());
12302 self
12303 }
12304 pub fn extra_fields(&self) -> &super::MoveTable {
12306 self.extra_fields
12307 .as_ref()
12308 .map(|field| field as _)
12309 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
12310 }
12311 pub fn extra_fields_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
12313 self.extra_fields.as_mut().map(|field| field as _)
12314 }
12315 pub fn extra_fields_mut(&mut self) -> &mut super::MoveTable {
12318 self.extra_fields.get_or_insert_default()
12319 }
12320 pub fn extra_fields_opt(&self) -> Option<&super::MoveTable> {
12322 self.extra_fields.as_ref().map(|field| field as _)
12323 }
12324 pub fn set_extra_fields<T: Into<super::MoveTable>>(&mut self, field: T) {
12326 self.extra_fields = Some(field.into().into());
12327 }
12328 pub fn with_extra_fields<T: Into<super::MoveTable>>(mut self, field: T) -> Self {
12330 self.set_extra_fields(field.into());
12331 self
12332 }
12333 }
12334 impl super::StakingPool {
12335 pub const fn const_default() -> Self {
12336 Self {
12337 id: None,
12338 activation_epoch: None,
12339 deactivation_epoch: None,
12340 sui_balance: None,
12341 rewards_pool: None,
12342 pool_token_balance: None,
12343 exchange_rates: None,
12344 pending_stake: None,
12345 pending_total_sui_withdraw: None,
12346 pending_pool_token_withdraw: None,
12347 extra_fields: None,
12348 }
12349 }
12350 #[doc(hidden)]
12351 pub fn default_instance() -> &'static Self {
12352 static DEFAULT: super::StakingPool = super::StakingPool::const_default();
12353 &DEFAULT
12354 }
12355 pub fn id_opt_mut(&mut self) -> Option<&mut String> {
12357 self.id.as_mut().map(|field| field as _)
12358 }
12359 pub fn id_mut(&mut self) -> &mut String {
12362 self.id.get_or_insert_default()
12363 }
12364 pub fn id_opt(&self) -> Option<&str> {
12366 self.id.as_ref().map(|field| field as _)
12367 }
12368 pub fn set_id<T: Into<String>>(&mut self, field: T) {
12370 self.id = Some(field.into().into());
12371 }
12372 pub fn with_id<T: Into<String>>(mut self, field: T) -> Self {
12374 self.set_id(field.into());
12375 self
12376 }
12377 pub fn activation_epoch_opt_mut(&mut self) -> Option<&mut u64> {
12379 self.activation_epoch.as_mut().map(|field| field as _)
12380 }
12381 pub fn activation_epoch_mut(&mut self) -> &mut u64 {
12384 self.activation_epoch.get_or_insert_default()
12385 }
12386 pub fn activation_epoch_opt(&self) -> Option<u64> {
12388 self.activation_epoch.as_ref().map(|field| *field)
12389 }
12390 pub fn set_activation_epoch<T: Into<u64>>(&mut self, field: T) {
12392 self.activation_epoch = Some(field.into().into());
12393 }
12394 pub fn with_activation_epoch<T: Into<u64>>(mut self, field: T) -> Self {
12396 self.set_activation_epoch(field.into());
12397 self
12398 }
12399 pub fn deactivation_epoch_opt_mut(&mut self) -> Option<&mut u64> {
12401 self.deactivation_epoch.as_mut().map(|field| field as _)
12402 }
12403 pub fn deactivation_epoch_mut(&mut self) -> &mut u64 {
12406 self.deactivation_epoch.get_or_insert_default()
12407 }
12408 pub fn deactivation_epoch_opt(&self) -> Option<u64> {
12410 self.deactivation_epoch.as_ref().map(|field| *field)
12411 }
12412 pub fn set_deactivation_epoch<T: Into<u64>>(&mut self, field: T) {
12414 self.deactivation_epoch = Some(field.into().into());
12415 }
12416 pub fn with_deactivation_epoch<T: Into<u64>>(mut self, field: T) -> Self {
12418 self.set_deactivation_epoch(field.into());
12419 self
12420 }
12421 pub fn sui_balance_opt_mut(&mut self) -> Option<&mut u64> {
12423 self.sui_balance.as_mut().map(|field| field as _)
12424 }
12425 pub fn sui_balance_mut(&mut self) -> &mut u64 {
12428 self.sui_balance.get_or_insert_default()
12429 }
12430 pub fn sui_balance_opt(&self) -> Option<u64> {
12432 self.sui_balance.as_ref().map(|field| *field)
12433 }
12434 pub fn set_sui_balance<T: Into<u64>>(&mut self, field: T) {
12436 self.sui_balance = Some(field.into().into());
12437 }
12438 pub fn with_sui_balance<T: Into<u64>>(mut self, field: T) -> Self {
12440 self.set_sui_balance(field.into());
12441 self
12442 }
12443 pub fn rewards_pool_opt_mut(&mut self) -> Option<&mut u64> {
12445 self.rewards_pool.as_mut().map(|field| field as _)
12446 }
12447 pub fn rewards_pool_mut(&mut self) -> &mut u64 {
12450 self.rewards_pool.get_or_insert_default()
12451 }
12452 pub fn rewards_pool_opt(&self) -> Option<u64> {
12454 self.rewards_pool.as_ref().map(|field| *field)
12455 }
12456 pub fn set_rewards_pool<T: Into<u64>>(&mut self, field: T) {
12458 self.rewards_pool = Some(field.into().into());
12459 }
12460 pub fn with_rewards_pool<T: Into<u64>>(mut self, field: T) -> Self {
12462 self.set_rewards_pool(field.into());
12463 self
12464 }
12465 pub fn pool_token_balance_opt_mut(&mut self) -> Option<&mut u64> {
12467 self.pool_token_balance.as_mut().map(|field| field as _)
12468 }
12469 pub fn pool_token_balance_mut(&mut self) -> &mut u64 {
12472 self.pool_token_balance.get_or_insert_default()
12473 }
12474 pub fn pool_token_balance_opt(&self) -> Option<u64> {
12476 self.pool_token_balance.as_ref().map(|field| *field)
12477 }
12478 pub fn set_pool_token_balance<T: Into<u64>>(&mut self, field: T) {
12480 self.pool_token_balance = Some(field.into().into());
12481 }
12482 pub fn with_pool_token_balance<T: Into<u64>>(mut self, field: T) -> Self {
12484 self.set_pool_token_balance(field.into());
12485 self
12486 }
12487 pub fn exchange_rates(&self) -> &super::MoveTable {
12489 self.exchange_rates
12490 .as_ref()
12491 .map(|field| field as _)
12492 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
12493 }
12494 pub fn exchange_rates_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
12496 self.exchange_rates.as_mut().map(|field| field as _)
12497 }
12498 pub fn exchange_rates_mut(&mut self) -> &mut super::MoveTable {
12501 self.exchange_rates.get_or_insert_default()
12502 }
12503 pub fn exchange_rates_opt(&self) -> Option<&super::MoveTable> {
12505 self.exchange_rates.as_ref().map(|field| field as _)
12506 }
12507 pub fn set_exchange_rates<T: Into<super::MoveTable>>(&mut self, field: T) {
12509 self.exchange_rates = Some(field.into().into());
12510 }
12511 pub fn with_exchange_rates<T: Into<super::MoveTable>>(
12513 mut self,
12514 field: T,
12515 ) -> Self {
12516 self.set_exchange_rates(field.into());
12517 self
12518 }
12519 pub fn pending_stake_opt_mut(&mut self) -> Option<&mut u64> {
12521 self.pending_stake.as_mut().map(|field| field as _)
12522 }
12523 pub fn pending_stake_mut(&mut self) -> &mut u64 {
12526 self.pending_stake.get_or_insert_default()
12527 }
12528 pub fn pending_stake_opt(&self) -> Option<u64> {
12530 self.pending_stake.as_ref().map(|field| *field)
12531 }
12532 pub fn set_pending_stake<T: Into<u64>>(&mut self, field: T) {
12534 self.pending_stake = Some(field.into().into());
12535 }
12536 pub fn with_pending_stake<T: Into<u64>>(mut self, field: T) -> Self {
12538 self.set_pending_stake(field.into());
12539 self
12540 }
12541 pub fn pending_total_sui_withdraw_opt_mut(&mut self) -> Option<&mut u64> {
12543 self.pending_total_sui_withdraw.as_mut().map(|field| field as _)
12544 }
12545 pub fn pending_total_sui_withdraw_mut(&mut self) -> &mut u64 {
12548 self.pending_total_sui_withdraw.get_or_insert_default()
12549 }
12550 pub fn pending_total_sui_withdraw_opt(&self) -> Option<u64> {
12552 self.pending_total_sui_withdraw.as_ref().map(|field| *field)
12553 }
12554 pub fn set_pending_total_sui_withdraw<T: Into<u64>>(&mut self, field: T) {
12556 self.pending_total_sui_withdraw = Some(field.into().into());
12557 }
12558 pub fn with_pending_total_sui_withdraw<T: Into<u64>>(
12560 mut self,
12561 field: T,
12562 ) -> Self {
12563 self.set_pending_total_sui_withdraw(field.into());
12564 self
12565 }
12566 pub fn pending_pool_token_withdraw_opt_mut(&mut self) -> Option<&mut u64> {
12568 self.pending_pool_token_withdraw.as_mut().map(|field| field as _)
12569 }
12570 pub fn pending_pool_token_withdraw_mut(&mut self) -> &mut u64 {
12573 self.pending_pool_token_withdraw.get_or_insert_default()
12574 }
12575 pub fn pending_pool_token_withdraw_opt(&self) -> Option<u64> {
12577 self.pending_pool_token_withdraw.as_ref().map(|field| *field)
12578 }
12579 pub fn set_pending_pool_token_withdraw<T: Into<u64>>(&mut self, field: T) {
12581 self.pending_pool_token_withdraw = Some(field.into().into());
12582 }
12583 pub fn with_pending_pool_token_withdraw<T: Into<u64>>(
12585 mut self,
12586 field: T,
12587 ) -> Self {
12588 self.set_pending_pool_token_withdraw(field.into());
12589 self
12590 }
12591 pub fn extra_fields(&self) -> &super::MoveTable {
12593 self.extra_fields
12594 .as_ref()
12595 .map(|field| field as _)
12596 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
12597 }
12598 pub fn extra_fields_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
12600 self.extra_fields.as_mut().map(|field| field as _)
12601 }
12602 pub fn extra_fields_mut(&mut self) -> &mut super::MoveTable {
12605 self.extra_fields.get_or_insert_default()
12606 }
12607 pub fn extra_fields_opt(&self) -> Option<&super::MoveTable> {
12609 self.extra_fields.as_ref().map(|field| field as _)
12610 }
12611 pub fn set_extra_fields<T: Into<super::MoveTable>>(&mut self, field: T) {
12613 self.extra_fields = Some(field.into().into());
12614 }
12615 pub fn with_extra_fields<T: Into<super::MoveTable>>(mut self, field: T) -> Self {
12617 self.set_extra_fields(field.into());
12618 self
12619 }
12620 }
12621 impl super::StorageFund {
12622 pub const fn const_default() -> Self {
12623 Self {
12624 total_object_storage_rebates: None,
12625 non_refundable_balance: None,
12626 }
12627 }
12628 #[doc(hidden)]
12629 pub fn default_instance() -> &'static Self {
12630 static DEFAULT: super::StorageFund = super::StorageFund::const_default();
12631 &DEFAULT
12632 }
12633 pub fn total_object_storage_rebates_opt_mut(&mut self) -> Option<&mut u64> {
12635 self.total_object_storage_rebates.as_mut().map(|field| field as _)
12636 }
12637 pub fn total_object_storage_rebates_mut(&mut self) -> &mut u64 {
12640 self.total_object_storage_rebates.get_or_insert_default()
12641 }
12642 pub fn total_object_storage_rebates_opt(&self) -> Option<u64> {
12644 self.total_object_storage_rebates.as_ref().map(|field| *field)
12645 }
12646 pub fn set_total_object_storage_rebates<T: Into<u64>>(&mut self, field: T) {
12648 self.total_object_storage_rebates = Some(field.into().into());
12649 }
12650 pub fn with_total_object_storage_rebates<T: Into<u64>>(
12652 mut self,
12653 field: T,
12654 ) -> Self {
12655 self.set_total_object_storage_rebates(field.into());
12656 self
12657 }
12658 pub fn non_refundable_balance_opt_mut(&mut self) -> Option<&mut u64> {
12660 self.non_refundable_balance.as_mut().map(|field| field as _)
12661 }
12662 pub fn non_refundable_balance_mut(&mut self) -> &mut u64 {
12665 self.non_refundable_balance.get_or_insert_default()
12666 }
12667 pub fn non_refundable_balance_opt(&self) -> Option<u64> {
12669 self.non_refundable_balance.as_ref().map(|field| *field)
12670 }
12671 pub fn set_non_refundable_balance<T: Into<u64>>(&mut self, field: T) {
12673 self.non_refundable_balance = Some(field.into().into());
12674 }
12675 pub fn with_non_refundable_balance<T: Into<u64>>(mut self, field: T) -> Self {
12677 self.set_non_refundable_balance(field.into());
12678 self
12679 }
12680 }
12681 impl super::SubscribeCheckpointsRequest {
12682 pub const fn const_default() -> Self {
12683 Self { read_mask: None }
12684 }
12685 #[doc(hidden)]
12686 pub fn default_instance() -> &'static Self {
12687 static DEFAULT: super::SubscribeCheckpointsRequest = super::SubscribeCheckpointsRequest::const_default();
12688 &DEFAULT
12689 }
12690 pub fn read_mask_opt_mut(&mut self) -> Option<&mut ::prost_types::FieldMask> {
12692 self.read_mask.as_mut().map(|field| field as _)
12693 }
12694 pub fn read_mask_mut(&mut self) -> &mut ::prost_types::FieldMask {
12697 self.read_mask.get_or_insert_default()
12698 }
12699 pub fn read_mask_opt(&self) -> Option<&::prost_types::FieldMask> {
12701 self.read_mask.as_ref().map(|field| field as _)
12702 }
12703 pub fn set_read_mask<T: Into<::prost_types::FieldMask>>(&mut self, field: T) {
12705 self.read_mask = Some(field.into().into());
12706 }
12707 pub fn with_read_mask<T: Into<::prost_types::FieldMask>>(
12709 mut self,
12710 field: T,
12711 ) -> Self {
12712 self.set_read_mask(field.into());
12713 self
12714 }
12715 }
12716 impl super::SubscribeCheckpointsResponse {
12717 pub const fn const_default() -> Self {
12718 Self {
12719 cursor: None,
12720 checkpoint: None,
12721 }
12722 }
12723 #[doc(hidden)]
12724 pub fn default_instance() -> &'static Self {
12725 static DEFAULT: super::SubscribeCheckpointsResponse = super::SubscribeCheckpointsResponse::const_default();
12726 &DEFAULT
12727 }
12728 pub fn cursor_opt_mut(&mut self) -> Option<&mut u64> {
12730 self.cursor.as_mut().map(|field| field as _)
12731 }
12732 pub fn cursor_mut(&mut self) -> &mut u64 {
12735 self.cursor.get_or_insert_default()
12736 }
12737 pub fn cursor_opt(&self) -> Option<u64> {
12739 self.cursor.as_ref().map(|field| *field)
12740 }
12741 pub fn set_cursor<T: Into<u64>>(&mut self, field: T) {
12743 self.cursor = Some(field.into().into());
12744 }
12745 pub fn with_cursor<T: Into<u64>>(mut self, field: T) -> Self {
12747 self.set_cursor(field.into());
12748 self
12749 }
12750 pub fn checkpoint(&self) -> &super::Checkpoint {
12752 self.checkpoint
12753 .as_ref()
12754 .map(|field| field as _)
12755 .unwrap_or_else(|| super::Checkpoint::default_instance() as _)
12756 }
12757 pub fn checkpoint_opt_mut(&mut self) -> Option<&mut super::Checkpoint> {
12759 self.checkpoint.as_mut().map(|field| field as _)
12760 }
12761 pub fn checkpoint_mut(&mut self) -> &mut super::Checkpoint {
12764 self.checkpoint.get_or_insert_default()
12765 }
12766 pub fn checkpoint_opt(&self) -> Option<&super::Checkpoint> {
12768 self.checkpoint.as_ref().map(|field| field as _)
12769 }
12770 pub fn set_checkpoint<T: Into<super::Checkpoint>>(&mut self, field: T) {
12772 self.checkpoint = Some(field.into().into());
12773 }
12774 pub fn with_checkpoint<T: Into<super::Checkpoint>>(mut self, field: T) -> Self {
12776 self.set_checkpoint(field.into());
12777 self
12778 }
12779 }
12780 impl super::SystemPackage {
12781 pub const fn const_default() -> Self {
12782 Self {
12783 version: None,
12784 modules: Vec::new(),
12785 dependencies: Vec::new(),
12786 }
12787 }
12788 #[doc(hidden)]
12789 pub fn default_instance() -> &'static Self {
12790 static DEFAULT: super::SystemPackage = super::SystemPackage::const_default();
12791 &DEFAULT
12792 }
12793 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
12795 self.version.as_mut().map(|field| field as _)
12796 }
12797 pub fn version_mut(&mut self) -> &mut u64 {
12800 self.version.get_or_insert_default()
12801 }
12802 pub fn version_opt(&self) -> Option<u64> {
12804 self.version.as_ref().map(|field| *field)
12805 }
12806 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
12808 self.version = Some(field.into().into());
12809 }
12810 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
12812 self.set_version(field.into());
12813 self
12814 }
12815 pub fn modules(&self) -> &[::prost::bytes::Bytes] {
12817 &self.modules
12818 }
12819 pub fn modules_mut(&mut self) -> &mut Vec<::prost::bytes::Bytes> {
12822 &mut self.modules
12823 }
12824 pub fn set_modules(&mut self, field: Vec<::prost::bytes::Bytes>) {
12826 self.modules = field;
12827 }
12828 pub fn with_modules(mut self, field: Vec<::prost::bytes::Bytes>) -> Self {
12830 self.set_modules(field);
12831 self
12832 }
12833 pub fn dependencies(&self) -> &[String] {
12835 &self.dependencies
12836 }
12837 pub fn dependencies_mut(&mut self) -> &mut Vec<String> {
12840 &mut self.dependencies
12841 }
12842 pub fn set_dependencies(&mut self, field: Vec<String>) {
12844 self.dependencies = field;
12845 }
12846 pub fn with_dependencies(mut self, field: Vec<String>) -> Self {
12848 self.set_dependencies(field);
12849 self
12850 }
12851 }
12852 impl super::SystemParameters {
12853 pub const fn const_default() -> Self {
12854 Self {
12855 epoch_duration_ms: None,
12856 stake_subsidy_start_epoch: None,
12857 min_validator_count: None,
12858 max_validator_count: None,
12859 min_validator_joining_stake: None,
12860 validator_low_stake_threshold: None,
12861 validator_very_low_stake_threshold: None,
12862 validator_low_stake_grace_period: None,
12863 extra_fields: None,
12864 }
12865 }
12866 #[doc(hidden)]
12867 pub fn default_instance() -> &'static Self {
12868 static DEFAULT: super::SystemParameters = super::SystemParameters::const_default();
12869 &DEFAULT
12870 }
12871 pub fn epoch_duration_ms_opt_mut(&mut self) -> Option<&mut u64> {
12873 self.epoch_duration_ms.as_mut().map(|field| field as _)
12874 }
12875 pub fn epoch_duration_ms_mut(&mut self) -> &mut u64 {
12878 self.epoch_duration_ms.get_or_insert_default()
12879 }
12880 pub fn epoch_duration_ms_opt(&self) -> Option<u64> {
12882 self.epoch_duration_ms.as_ref().map(|field| *field)
12883 }
12884 pub fn set_epoch_duration_ms<T: Into<u64>>(&mut self, field: T) {
12886 self.epoch_duration_ms = Some(field.into().into());
12887 }
12888 pub fn with_epoch_duration_ms<T: Into<u64>>(mut self, field: T) -> Self {
12890 self.set_epoch_duration_ms(field.into());
12891 self
12892 }
12893 pub fn stake_subsidy_start_epoch_opt_mut(&mut self) -> Option<&mut u64> {
12895 self.stake_subsidy_start_epoch.as_mut().map(|field| field as _)
12896 }
12897 pub fn stake_subsidy_start_epoch_mut(&mut self) -> &mut u64 {
12900 self.stake_subsidy_start_epoch.get_or_insert_default()
12901 }
12902 pub fn stake_subsidy_start_epoch_opt(&self) -> Option<u64> {
12904 self.stake_subsidy_start_epoch.as_ref().map(|field| *field)
12905 }
12906 pub fn set_stake_subsidy_start_epoch<T: Into<u64>>(&mut self, field: T) {
12908 self.stake_subsidy_start_epoch = Some(field.into().into());
12909 }
12910 pub fn with_stake_subsidy_start_epoch<T: Into<u64>>(mut self, field: T) -> Self {
12912 self.set_stake_subsidy_start_epoch(field.into());
12913 self
12914 }
12915 pub fn min_validator_count_opt_mut(&mut self) -> Option<&mut u64> {
12917 self.min_validator_count.as_mut().map(|field| field as _)
12918 }
12919 pub fn min_validator_count_mut(&mut self) -> &mut u64 {
12922 self.min_validator_count.get_or_insert_default()
12923 }
12924 pub fn min_validator_count_opt(&self) -> Option<u64> {
12926 self.min_validator_count.as_ref().map(|field| *field)
12927 }
12928 pub fn set_min_validator_count<T: Into<u64>>(&mut self, field: T) {
12930 self.min_validator_count = Some(field.into().into());
12931 }
12932 pub fn with_min_validator_count<T: Into<u64>>(mut self, field: T) -> Self {
12934 self.set_min_validator_count(field.into());
12935 self
12936 }
12937 pub fn max_validator_count_opt_mut(&mut self) -> Option<&mut u64> {
12939 self.max_validator_count.as_mut().map(|field| field as _)
12940 }
12941 pub fn max_validator_count_mut(&mut self) -> &mut u64 {
12944 self.max_validator_count.get_or_insert_default()
12945 }
12946 pub fn max_validator_count_opt(&self) -> Option<u64> {
12948 self.max_validator_count.as_ref().map(|field| *field)
12949 }
12950 pub fn set_max_validator_count<T: Into<u64>>(&mut self, field: T) {
12952 self.max_validator_count = Some(field.into().into());
12953 }
12954 pub fn with_max_validator_count<T: Into<u64>>(mut self, field: T) -> Self {
12956 self.set_max_validator_count(field.into());
12957 self
12958 }
12959 pub fn min_validator_joining_stake_opt_mut(&mut self) -> Option<&mut u64> {
12961 self.min_validator_joining_stake.as_mut().map(|field| field as _)
12962 }
12963 pub fn min_validator_joining_stake_mut(&mut self) -> &mut u64 {
12966 self.min_validator_joining_stake.get_or_insert_default()
12967 }
12968 pub fn min_validator_joining_stake_opt(&self) -> Option<u64> {
12970 self.min_validator_joining_stake.as_ref().map(|field| *field)
12971 }
12972 pub fn set_min_validator_joining_stake<T: Into<u64>>(&mut self, field: T) {
12974 self.min_validator_joining_stake = Some(field.into().into());
12975 }
12976 pub fn with_min_validator_joining_stake<T: Into<u64>>(
12978 mut self,
12979 field: T,
12980 ) -> Self {
12981 self.set_min_validator_joining_stake(field.into());
12982 self
12983 }
12984 pub fn validator_low_stake_threshold_opt_mut(&mut self) -> Option<&mut u64> {
12986 self.validator_low_stake_threshold.as_mut().map(|field| field as _)
12987 }
12988 pub fn validator_low_stake_threshold_mut(&mut self) -> &mut u64 {
12991 self.validator_low_stake_threshold.get_or_insert_default()
12992 }
12993 pub fn validator_low_stake_threshold_opt(&self) -> Option<u64> {
12995 self.validator_low_stake_threshold.as_ref().map(|field| *field)
12996 }
12997 pub fn set_validator_low_stake_threshold<T: Into<u64>>(&mut self, field: T) {
12999 self.validator_low_stake_threshold = Some(field.into().into());
13000 }
13001 pub fn with_validator_low_stake_threshold<T: Into<u64>>(
13003 mut self,
13004 field: T,
13005 ) -> Self {
13006 self.set_validator_low_stake_threshold(field.into());
13007 self
13008 }
13009 pub fn validator_very_low_stake_threshold_opt_mut(
13011 &mut self,
13012 ) -> Option<&mut u64> {
13013 self.validator_very_low_stake_threshold.as_mut().map(|field| field as _)
13014 }
13015 pub fn validator_very_low_stake_threshold_mut(&mut self) -> &mut u64 {
13018 self.validator_very_low_stake_threshold.get_or_insert_default()
13019 }
13020 pub fn validator_very_low_stake_threshold_opt(&self) -> Option<u64> {
13022 self.validator_very_low_stake_threshold.as_ref().map(|field| *field)
13023 }
13024 pub fn set_validator_very_low_stake_threshold<T: Into<u64>>(
13026 &mut self,
13027 field: T,
13028 ) {
13029 self.validator_very_low_stake_threshold = Some(field.into().into());
13030 }
13031 pub fn with_validator_very_low_stake_threshold<T: Into<u64>>(
13033 mut self,
13034 field: T,
13035 ) -> Self {
13036 self.set_validator_very_low_stake_threshold(field.into());
13037 self
13038 }
13039 pub fn validator_low_stake_grace_period_opt_mut(&mut self) -> Option<&mut u64> {
13041 self.validator_low_stake_grace_period.as_mut().map(|field| field as _)
13042 }
13043 pub fn validator_low_stake_grace_period_mut(&mut self) -> &mut u64 {
13046 self.validator_low_stake_grace_period.get_or_insert_default()
13047 }
13048 pub fn validator_low_stake_grace_period_opt(&self) -> Option<u64> {
13050 self.validator_low_stake_grace_period.as_ref().map(|field| *field)
13051 }
13052 pub fn set_validator_low_stake_grace_period<T: Into<u64>>(&mut self, field: T) {
13054 self.validator_low_stake_grace_period = Some(field.into().into());
13055 }
13056 pub fn with_validator_low_stake_grace_period<T: Into<u64>>(
13058 mut self,
13059 field: T,
13060 ) -> Self {
13061 self.set_validator_low_stake_grace_period(field.into());
13062 self
13063 }
13064 pub fn extra_fields(&self) -> &super::MoveTable {
13066 self.extra_fields
13067 .as_ref()
13068 .map(|field| field as _)
13069 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
13070 }
13071 pub fn extra_fields_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
13073 self.extra_fields.as_mut().map(|field| field as _)
13074 }
13075 pub fn extra_fields_mut(&mut self) -> &mut super::MoveTable {
13078 self.extra_fields.get_or_insert_default()
13079 }
13080 pub fn extra_fields_opt(&self) -> Option<&super::MoveTable> {
13082 self.extra_fields.as_ref().map(|field| field as _)
13083 }
13084 pub fn set_extra_fields<T: Into<super::MoveTable>>(&mut self, field: T) {
13086 self.extra_fields = Some(field.into().into());
13087 }
13088 pub fn with_extra_fields<T: Into<super::MoveTable>>(mut self, field: T) -> Self {
13090 self.set_extra_fields(field.into());
13091 self
13092 }
13093 }
13094 impl super::SystemState {
13095 pub const fn const_default() -> Self {
13096 Self {
13097 version: None,
13098 epoch: None,
13099 protocol_version: None,
13100 validators: None,
13101 storage_fund: None,
13102 parameters: None,
13103 reference_gas_price: None,
13104 validator_report_records: Vec::new(),
13105 stake_subsidy: None,
13106 safe_mode: None,
13107 safe_mode_storage_rewards: None,
13108 safe_mode_computation_rewards: None,
13109 safe_mode_storage_rebates: None,
13110 safe_mode_non_refundable_storage_fee: None,
13111 epoch_start_timestamp_ms: None,
13112 extra_fields: None,
13113 }
13114 }
13115 #[doc(hidden)]
13116 pub fn default_instance() -> &'static Self {
13117 static DEFAULT: super::SystemState = super::SystemState::const_default();
13118 &DEFAULT
13119 }
13120 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
13122 self.version.as_mut().map(|field| field as _)
13123 }
13124 pub fn version_mut(&mut self) -> &mut u64 {
13127 self.version.get_or_insert_default()
13128 }
13129 pub fn version_opt(&self) -> Option<u64> {
13131 self.version.as_ref().map(|field| *field)
13132 }
13133 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
13135 self.version = Some(field.into().into());
13136 }
13137 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
13139 self.set_version(field.into());
13140 self
13141 }
13142 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
13144 self.epoch.as_mut().map(|field| field as _)
13145 }
13146 pub fn epoch_mut(&mut self) -> &mut u64 {
13149 self.epoch.get_or_insert_default()
13150 }
13151 pub fn epoch_opt(&self) -> Option<u64> {
13153 self.epoch.as_ref().map(|field| *field)
13154 }
13155 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
13157 self.epoch = Some(field.into().into());
13158 }
13159 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
13161 self.set_epoch(field.into());
13162 self
13163 }
13164 pub fn protocol_version_opt_mut(&mut self) -> Option<&mut u64> {
13166 self.protocol_version.as_mut().map(|field| field as _)
13167 }
13168 pub fn protocol_version_mut(&mut self) -> &mut u64 {
13171 self.protocol_version.get_or_insert_default()
13172 }
13173 pub fn protocol_version_opt(&self) -> Option<u64> {
13175 self.protocol_version.as_ref().map(|field| *field)
13176 }
13177 pub fn set_protocol_version<T: Into<u64>>(&mut self, field: T) {
13179 self.protocol_version = Some(field.into().into());
13180 }
13181 pub fn with_protocol_version<T: Into<u64>>(mut self, field: T) -> Self {
13183 self.set_protocol_version(field.into());
13184 self
13185 }
13186 pub fn validators(&self) -> &super::ValidatorSet {
13188 self.validators
13189 .as_ref()
13190 .map(|field| field as _)
13191 .unwrap_or_else(|| super::ValidatorSet::default_instance() as _)
13192 }
13193 pub fn validators_opt_mut(&mut self) -> Option<&mut super::ValidatorSet> {
13195 self.validators.as_mut().map(|field| field as _)
13196 }
13197 pub fn validators_mut(&mut self) -> &mut super::ValidatorSet {
13200 self.validators.get_or_insert_default()
13201 }
13202 pub fn validators_opt(&self) -> Option<&super::ValidatorSet> {
13204 self.validators.as_ref().map(|field| field as _)
13205 }
13206 pub fn set_validators<T: Into<super::ValidatorSet>>(&mut self, field: T) {
13208 self.validators = Some(field.into().into());
13209 }
13210 pub fn with_validators<T: Into<super::ValidatorSet>>(
13212 mut self,
13213 field: T,
13214 ) -> Self {
13215 self.set_validators(field.into());
13216 self
13217 }
13218 pub fn storage_fund(&self) -> &super::StorageFund {
13220 self.storage_fund
13221 .as_ref()
13222 .map(|field| field as _)
13223 .unwrap_or_else(|| super::StorageFund::default_instance() as _)
13224 }
13225 pub fn storage_fund_opt_mut(&mut self) -> Option<&mut super::StorageFund> {
13227 self.storage_fund.as_mut().map(|field| field as _)
13228 }
13229 pub fn storage_fund_mut(&mut self) -> &mut super::StorageFund {
13232 self.storage_fund.get_or_insert_default()
13233 }
13234 pub fn storage_fund_opt(&self) -> Option<&super::StorageFund> {
13236 self.storage_fund.as_ref().map(|field| field as _)
13237 }
13238 pub fn set_storage_fund<T: Into<super::StorageFund>>(&mut self, field: T) {
13240 self.storage_fund = Some(field.into().into());
13241 }
13242 pub fn with_storage_fund<T: Into<super::StorageFund>>(
13244 mut self,
13245 field: T,
13246 ) -> Self {
13247 self.set_storage_fund(field.into());
13248 self
13249 }
13250 pub fn parameters(&self) -> &super::SystemParameters {
13252 self.parameters
13253 .as_ref()
13254 .map(|field| field as _)
13255 .unwrap_or_else(|| super::SystemParameters::default_instance() as _)
13256 }
13257 pub fn parameters_opt_mut(&mut self) -> Option<&mut super::SystemParameters> {
13259 self.parameters.as_mut().map(|field| field as _)
13260 }
13261 pub fn parameters_mut(&mut self) -> &mut super::SystemParameters {
13264 self.parameters.get_or_insert_default()
13265 }
13266 pub fn parameters_opt(&self) -> Option<&super::SystemParameters> {
13268 self.parameters.as_ref().map(|field| field as _)
13269 }
13270 pub fn set_parameters<T: Into<super::SystemParameters>>(&mut self, field: T) {
13272 self.parameters = Some(field.into().into());
13273 }
13274 pub fn with_parameters<T: Into<super::SystemParameters>>(
13276 mut self,
13277 field: T,
13278 ) -> Self {
13279 self.set_parameters(field.into());
13280 self
13281 }
13282 pub fn reference_gas_price_opt_mut(&mut self) -> Option<&mut u64> {
13284 self.reference_gas_price.as_mut().map(|field| field as _)
13285 }
13286 pub fn reference_gas_price_mut(&mut self) -> &mut u64 {
13289 self.reference_gas_price.get_or_insert_default()
13290 }
13291 pub fn reference_gas_price_opt(&self) -> Option<u64> {
13293 self.reference_gas_price.as_ref().map(|field| *field)
13294 }
13295 pub fn set_reference_gas_price<T: Into<u64>>(&mut self, field: T) {
13297 self.reference_gas_price = Some(field.into().into());
13298 }
13299 pub fn with_reference_gas_price<T: Into<u64>>(mut self, field: T) -> Self {
13301 self.set_reference_gas_price(field.into());
13302 self
13303 }
13304 pub fn validator_report_records(&self) -> &[super::ValidatorReportRecord] {
13306 &self.validator_report_records
13307 }
13308 pub fn validator_report_records_mut(
13311 &mut self,
13312 ) -> &mut Vec<super::ValidatorReportRecord> {
13313 &mut self.validator_report_records
13314 }
13315 pub fn set_validator_report_records(
13317 &mut self,
13318 field: Vec<super::ValidatorReportRecord>,
13319 ) {
13320 self.validator_report_records = field;
13321 }
13322 pub fn with_validator_report_records(
13324 mut self,
13325 field: Vec<super::ValidatorReportRecord>,
13326 ) -> Self {
13327 self.set_validator_report_records(field);
13328 self
13329 }
13330 pub fn stake_subsidy(&self) -> &super::StakeSubsidy {
13332 self.stake_subsidy
13333 .as_ref()
13334 .map(|field| field as _)
13335 .unwrap_or_else(|| super::StakeSubsidy::default_instance() as _)
13336 }
13337 pub fn stake_subsidy_opt_mut(&mut self) -> Option<&mut super::StakeSubsidy> {
13339 self.stake_subsidy.as_mut().map(|field| field as _)
13340 }
13341 pub fn stake_subsidy_mut(&mut self) -> &mut super::StakeSubsidy {
13344 self.stake_subsidy.get_or_insert_default()
13345 }
13346 pub fn stake_subsidy_opt(&self) -> Option<&super::StakeSubsidy> {
13348 self.stake_subsidy.as_ref().map(|field| field as _)
13349 }
13350 pub fn set_stake_subsidy<T: Into<super::StakeSubsidy>>(&mut self, field: T) {
13352 self.stake_subsidy = Some(field.into().into());
13353 }
13354 pub fn with_stake_subsidy<T: Into<super::StakeSubsidy>>(
13356 mut self,
13357 field: T,
13358 ) -> Self {
13359 self.set_stake_subsidy(field.into());
13360 self
13361 }
13362 pub fn safe_mode_opt_mut(&mut self) -> Option<&mut bool> {
13364 self.safe_mode.as_mut().map(|field| field as _)
13365 }
13366 pub fn safe_mode_mut(&mut self) -> &mut bool {
13369 self.safe_mode.get_or_insert_default()
13370 }
13371 pub fn safe_mode_opt(&self) -> Option<bool> {
13373 self.safe_mode.as_ref().map(|field| *field)
13374 }
13375 pub fn set_safe_mode<T: Into<bool>>(&mut self, field: T) {
13377 self.safe_mode = Some(field.into().into());
13378 }
13379 pub fn with_safe_mode<T: Into<bool>>(mut self, field: T) -> Self {
13381 self.set_safe_mode(field.into());
13382 self
13383 }
13384 pub fn safe_mode_storage_rewards_opt_mut(&mut self) -> Option<&mut u64> {
13386 self.safe_mode_storage_rewards.as_mut().map(|field| field as _)
13387 }
13388 pub fn safe_mode_storage_rewards_mut(&mut self) -> &mut u64 {
13391 self.safe_mode_storage_rewards.get_or_insert_default()
13392 }
13393 pub fn safe_mode_storage_rewards_opt(&self) -> Option<u64> {
13395 self.safe_mode_storage_rewards.as_ref().map(|field| *field)
13396 }
13397 pub fn set_safe_mode_storage_rewards<T: Into<u64>>(&mut self, field: T) {
13399 self.safe_mode_storage_rewards = Some(field.into().into());
13400 }
13401 pub fn with_safe_mode_storage_rewards<T: Into<u64>>(mut self, field: T) -> Self {
13403 self.set_safe_mode_storage_rewards(field.into());
13404 self
13405 }
13406 pub fn safe_mode_computation_rewards_opt_mut(&mut self) -> Option<&mut u64> {
13408 self.safe_mode_computation_rewards.as_mut().map(|field| field as _)
13409 }
13410 pub fn safe_mode_computation_rewards_mut(&mut self) -> &mut u64 {
13413 self.safe_mode_computation_rewards.get_or_insert_default()
13414 }
13415 pub fn safe_mode_computation_rewards_opt(&self) -> Option<u64> {
13417 self.safe_mode_computation_rewards.as_ref().map(|field| *field)
13418 }
13419 pub fn set_safe_mode_computation_rewards<T: Into<u64>>(&mut self, field: T) {
13421 self.safe_mode_computation_rewards = Some(field.into().into());
13422 }
13423 pub fn with_safe_mode_computation_rewards<T: Into<u64>>(
13425 mut self,
13426 field: T,
13427 ) -> Self {
13428 self.set_safe_mode_computation_rewards(field.into());
13429 self
13430 }
13431 pub fn safe_mode_storage_rebates_opt_mut(&mut self) -> Option<&mut u64> {
13433 self.safe_mode_storage_rebates.as_mut().map(|field| field as _)
13434 }
13435 pub fn safe_mode_storage_rebates_mut(&mut self) -> &mut u64 {
13438 self.safe_mode_storage_rebates.get_or_insert_default()
13439 }
13440 pub fn safe_mode_storage_rebates_opt(&self) -> Option<u64> {
13442 self.safe_mode_storage_rebates.as_ref().map(|field| *field)
13443 }
13444 pub fn set_safe_mode_storage_rebates<T: Into<u64>>(&mut self, field: T) {
13446 self.safe_mode_storage_rebates = Some(field.into().into());
13447 }
13448 pub fn with_safe_mode_storage_rebates<T: Into<u64>>(mut self, field: T) -> Self {
13450 self.set_safe_mode_storage_rebates(field.into());
13451 self
13452 }
13453 pub fn safe_mode_non_refundable_storage_fee_opt_mut(
13455 &mut self,
13456 ) -> Option<&mut u64> {
13457 self.safe_mode_non_refundable_storage_fee.as_mut().map(|field| field as _)
13458 }
13459 pub fn safe_mode_non_refundable_storage_fee_mut(&mut self) -> &mut u64 {
13462 self.safe_mode_non_refundable_storage_fee.get_or_insert_default()
13463 }
13464 pub fn safe_mode_non_refundable_storage_fee_opt(&self) -> Option<u64> {
13466 self.safe_mode_non_refundable_storage_fee.as_ref().map(|field| *field)
13467 }
13468 pub fn set_safe_mode_non_refundable_storage_fee<T: Into<u64>>(
13470 &mut self,
13471 field: T,
13472 ) {
13473 self.safe_mode_non_refundable_storage_fee = Some(field.into().into());
13474 }
13475 pub fn with_safe_mode_non_refundable_storage_fee<T: Into<u64>>(
13477 mut self,
13478 field: T,
13479 ) -> Self {
13480 self.set_safe_mode_non_refundable_storage_fee(field.into());
13481 self
13482 }
13483 pub fn epoch_start_timestamp_ms_opt_mut(&mut self) -> Option<&mut u64> {
13485 self.epoch_start_timestamp_ms.as_mut().map(|field| field as _)
13486 }
13487 pub fn epoch_start_timestamp_ms_mut(&mut self) -> &mut u64 {
13490 self.epoch_start_timestamp_ms.get_or_insert_default()
13491 }
13492 pub fn epoch_start_timestamp_ms_opt(&self) -> Option<u64> {
13494 self.epoch_start_timestamp_ms.as_ref().map(|field| *field)
13495 }
13496 pub fn set_epoch_start_timestamp_ms<T: Into<u64>>(&mut self, field: T) {
13498 self.epoch_start_timestamp_ms = Some(field.into().into());
13499 }
13500 pub fn with_epoch_start_timestamp_ms<T: Into<u64>>(mut self, field: T) -> Self {
13502 self.set_epoch_start_timestamp_ms(field.into());
13503 self
13504 }
13505 pub fn extra_fields(&self) -> &super::MoveTable {
13507 self.extra_fields
13508 .as_ref()
13509 .map(|field| field as _)
13510 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
13511 }
13512 pub fn extra_fields_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
13514 self.extra_fields.as_mut().map(|field| field as _)
13515 }
13516 pub fn extra_fields_mut(&mut self) -> &mut super::MoveTable {
13519 self.extra_fields.get_or_insert_default()
13520 }
13521 pub fn extra_fields_opt(&self) -> Option<&super::MoveTable> {
13523 self.extra_fields.as_ref().map(|field| field as _)
13524 }
13525 pub fn set_extra_fields<T: Into<super::MoveTable>>(&mut self, field: T) {
13527 self.extra_fields = Some(field.into().into());
13528 }
13529 pub fn with_extra_fields<T: Into<super::MoveTable>>(mut self, field: T) -> Self {
13531 self.set_extra_fields(field.into());
13532 self
13533 }
13534 }
13535 impl super::Transaction {
13536 pub const fn const_default() -> Self {
13537 Self {
13538 bcs: None,
13539 digest: None,
13540 version: None,
13541 kind: None,
13542 sender: None,
13543 gas_payment: None,
13544 expiration: None,
13545 }
13546 }
13547 #[doc(hidden)]
13548 pub fn default_instance() -> &'static Self {
13549 static DEFAULT: super::Transaction = super::Transaction::const_default();
13550 &DEFAULT
13551 }
13552 pub fn bcs(&self) -> &super::Bcs {
13554 self.bcs
13555 .as_ref()
13556 .map(|field| field as _)
13557 .unwrap_or_else(|| super::Bcs::default_instance() as _)
13558 }
13559 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
13561 self.bcs.as_mut().map(|field| field as _)
13562 }
13563 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
13566 self.bcs.get_or_insert_default()
13567 }
13568 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
13570 self.bcs.as_ref().map(|field| field as _)
13571 }
13572 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
13574 self.bcs = Some(field.into().into());
13575 }
13576 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
13578 self.set_bcs(field.into());
13579 self
13580 }
13581 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
13583 self.digest.as_mut().map(|field| field as _)
13584 }
13585 pub fn digest_mut(&mut self) -> &mut String {
13588 self.digest.get_or_insert_default()
13589 }
13590 pub fn digest_opt(&self) -> Option<&str> {
13592 self.digest.as_ref().map(|field| field as _)
13593 }
13594 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
13596 self.digest = Some(field.into().into());
13597 }
13598 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
13600 self.set_digest(field.into());
13601 self
13602 }
13603 pub fn version_opt_mut(&mut self) -> Option<&mut i32> {
13605 self.version.as_mut().map(|field| field as _)
13606 }
13607 pub fn version_mut(&mut self) -> &mut i32 {
13610 self.version.get_or_insert_default()
13611 }
13612 pub fn version_opt(&self) -> Option<i32> {
13614 self.version.as_ref().map(|field| *field)
13615 }
13616 pub fn set_version<T: Into<i32>>(&mut self, field: T) {
13618 self.version = Some(field.into().into());
13619 }
13620 pub fn with_version<T: Into<i32>>(mut self, field: T) -> Self {
13622 self.set_version(field.into());
13623 self
13624 }
13625 pub fn kind(&self) -> &super::TransactionKind {
13627 self.kind
13628 .as_ref()
13629 .map(|field| field as _)
13630 .unwrap_or_else(|| super::TransactionKind::default_instance() as _)
13631 }
13632 pub fn kind_opt_mut(&mut self) -> Option<&mut super::TransactionKind> {
13634 self.kind.as_mut().map(|field| field as _)
13635 }
13636 pub fn kind_mut(&mut self) -> &mut super::TransactionKind {
13639 self.kind.get_or_insert_default()
13640 }
13641 pub fn kind_opt(&self) -> Option<&super::TransactionKind> {
13643 self.kind.as_ref().map(|field| field as _)
13644 }
13645 pub fn set_kind<T: Into<super::TransactionKind>>(&mut self, field: T) {
13647 self.kind = Some(field.into().into());
13648 }
13649 pub fn with_kind<T: Into<super::TransactionKind>>(mut self, field: T) -> Self {
13651 self.set_kind(field.into());
13652 self
13653 }
13654 pub fn sender_opt_mut(&mut self) -> Option<&mut String> {
13656 self.sender.as_mut().map(|field| field as _)
13657 }
13658 pub fn sender_mut(&mut self) -> &mut String {
13661 self.sender.get_or_insert_default()
13662 }
13663 pub fn sender_opt(&self) -> Option<&str> {
13665 self.sender.as_ref().map(|field| field as _)
13666 }
13667 pub fn set_sender<T: Into<String>>(&mut self, field: T) {
13669 self.sender = Some(field.into().into());
13670 }
13671 pub fn with_sender<T: Into<String>>(mut self, field: T) -> Self {
13673 self.set_sender(field.into());
13674 self
13675 }
13676 pub fn gas_payment(&self) -> &super::GasPayment {
13678 self.gas_payment
13679 .as_ref()
13680 .map(|field| field as _)
13681 .unwrap_or_else(|| super::GasPayment::default_instance() as _)
13682 }
13683 pub fn gas_payment_opt_mut(&mut self) -> Option<&mut super::GasPayment> {
13685 self.gas_payment.as_mut().map(|field| field as _)
13686 }
13687 pub fn gas_payment_mut(&mut self) -> &mut super::GasPayment {
13690 self.gas_payment.get_or_insert_default()
13691 }
13692 pub fn gas_payment_opt(&self) -> Option<&super::GasPayment> {
13694 self.gas_payment.as_ref().map(|field| field as _)
13695 }
13696 pub fn set_gas_payment<T: Into<super::GasPayment>>(&mut self, field: T) {
13698 self.gas_payment = Some(field.into().into());
13699 }
13700 pub fn with_gas_payment<T: Into<super::GasPayment>>(mut self, field: T) -> Self {
13702 self.set_gas_payment(field.into());
13703 self
13704 }
13705 pub fn expiration(&self) -> &super::TransactionExpiration {
13707 self.expiration
13708 .as_ref()
13709 .map(|field| field as _)
13710 .unwrap_or_else(|| super::TransactionExpiration::default_instance() as _)
13711 }
13712 pub fn expiration_opt_mut(
13714 &mut self,
13715 ) -> Option<&mut super::TransactionExpiration> {
13716 self.expiration.as_mut().map(|field| field as _)
13717 }
13718 pub fn expiration_mut(&mut self) -> &mut super::TransactionExpiration {
13721 self.expiration.get_or_insert_default()
13722 }
13723 pub fn expiration_opt(&self) -> Option<&super::TransactionExpiration> {
13725 self.expiration.as_ref().map(|field| field as _)
13726 }
13727 pub fn set_expiration<T: Into<super::TransactionExpiration>>(
13729 &mut self,
13730 field: T,
13731 ) {
13732 self.expiration = Some(field.into().into());
13733 }
13734 pub fn with_expiration<T: Into<super::TransactionExpiration>>(
13736 mut self,
13737 field: T,
13738 ) -> Self {
13739 self.set_expiration(field.into());
13740 self
13741 }
13742 }
13743 impl super::TransactionEffects {
13744 pub const fn const_default() -> Self {
13745 Self {
13746 bcs: None,
13747 digest: None,
13748 version: None,
13749 status: None,
13750 epoch: None,
13751 gas_used: None,
13752 transaction_digest: None,
13753 gas_object: None,
13754 events_digest: None,
13755 dependencies: Vec::new(),
13756 lamport_version: None,
13757 changed_objects: Vec::new(),
13758 unchanged_consensus_objects: Vec::new(),
13759 auxiliary_data_digest: None,
13760 }
13761 }
13762 #[doc(hidden)]
13763 pub fn default_instance() -> &'static Self {
13764 static DEFAULT: super::TransactionEffects = super::TransactionEffects::const_default();
13765 &DEFAULT
13766 }
13767 pub fn bcs(&self) -> &super::Bcs {
13769 self.bcs
13770 .as_ref()
13771 .map(|field| field as _)
13772 .unwrap_or_else(|| super::Bcs::default_instance() as _)
13773 }
13774 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
13776 self.bcs.as_mut().map(|field| field as _)
13777 }
13778 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
13781 self.bcs.get_or_insert_default()
13782 }
13783 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
13785 self.bcs.as_ref().map(|field| field as _)
13786 }
13787 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
13789 self.bcs = Some(field.into().into());
13790 }
13791 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
13793 self.set_bcs(field.into());
13794 self
13795 }
13796 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
13798 self.digest.as_mut().map(|field| field as _)
13799 }
13800 pub fn digest_mut(&mut self) -> &mut String {
13803 self.digest.get_or_insert_default()
13804 }
13805 pub fn digest_opt(&self) -> Option<&str> {
13807 self.digest.as_ref().map(|field| field as _)
13808 }
13809 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
13811 self.digest = Some(field.into().into());
13812 }
13813 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
13815 self.set_digest(field.into());
13816 self
13817 }
13818 pub fn version_opt_mut(&mut self) -> Option<&mut i32> {
13820 self.version.as_mut().map(|field| field as _)
13821 }
13822 pub fn version_mut(&mut self) -> &mut i32 {
13825 self.version.get_or_insert_default()
13826 }
13827 pub fn version_opt(&self) -> Option<i32> {
13829 self.version.as_ref().map(|field| *field)
13830 }
13831 pub fn set_version<T: Into<i32>>(&mut self, field: T) {
13833 self.version = Some(field.into().into());
13834 }
13835 pub fn with_version<T: Into<i32>>(mut self, field: T) -> Self {
13837 self.set_version(field.into());
13838 self
13839 }
13840 pub fn status(&self) -> &super::ExecutionStatus {
13842 self.status
13843 .as_ref()
13844 .map(|field| field as _)
13845 .unwrap_or_else(|| super::ExecutionStatus::default_instance() as _)
13846 }
13847 pub fn status_opt_mut(&mut self) -> Option<&mut super::ExecutionStatus> {
13849 self.status.as_mut().map(|field| field as _)
13850 }
13851 pub fn status_mut(&mut self) -> &mut super::ExecutionStatus {
13854 self.status.get_or_insert_default()
13855 }
13856 pub fn status_opt(&self) -> Option<&super::ExecutionStatus> {
13858 self.status.as_ref().map(|field| field as _)
13859 }
13860 pub fn set_status<T: Into<super::ExecutionStatus>>(&mut self, field: T) {
13862 self.status = Some(field.into().into());
13863 }
13864 pub fn with_status<T: Into<super::ExecutionStatus>>(mut self, field: T) -> Self {
13866 self.set_status(field.into());
13867 self
13868 }
13869 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
13871 self.epoch.as_mut().map(|field| field as _)
13872 }
13873 pub fn epoch_mut(&mut self) -> &mut u64 {
13876 self.epoch.get_or_insert_default()
13877 }
13878 pub fn epoch_opt(&self) -> Option<u64> {
13880 self.epoch.as_ref().map(|field| *field)
13881 }
13882 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
13884 self.epoch = Some(field.into().into());
13885 }
13886 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
13888 self.set_epoch(field.into());
13889 self
13890 }
13891 pub fn gas_used(&self) -> &super::GasCostSummary {
13893 self.gas_used
13894 .as_ref()
13895 .map(|field| field as _)
13896 .unwrap_or_else(|| super::GasCostSummary::default_instance() as _)
13897 }
13898 pub fn gas_used_opt_mut(&mut self) -> Option<&mut super::GasCostSummary> {
13900 self.gas_used.as_mut().map(|field| field as _)
13901 }
13902 pub fn gas_used_mut(&mut self) -> &mut super::GasCostSummary {
13905 self.gas_used.get_or_insert_default()
13906 }
13907 pub fn gas_used_opt(&self) -> Option<&super::GasCostSummary> {
13909 self.gas_used.as_ref().map(|field| field as _)
13910 }
13911 pub fn set_gas_used<T: Into<super::GasCostSummary>>(&mut self, field: T) {
13913 self.gas_used = Some(field.into().into());
13914 }
13915 pub fn with_gas_used<T: Into<super::GasCostSummary>>(
13917 mut self,
13918 field: T,
13919 ) -> Self {
13920 self.set_gas_used(field.into());
13921 self
13922 }
13923 pub fn transaction_digest_opt_mut(&mut self) -> Option<&mut String> {
13925 self.transaction_digest.as_mut().map(|field| field as _)
13926 }
13927 pub fn transaction_digest_mut(&mut self) -> &mut String {
13930 self.transaction_digest.get_or_insert_default()
13931 }
13932 pub fn transaction_digest_opt(&self) -> Option<&str> {
13934 self.transaction_digest.as_ref().map(|field| field as _)
13935 }
13936 pub fn set_transaction_digest<T: Into<String>>(&mut self, field: T) {
13938 self.transaction_digest = Some(field.into().into());
13939 }
13940 pub fn with_transaction_digest<T: Into<String>>(mut self, field: T) -> Self {
13942 self.set_transaction_digest(field.into());
13943 self
13944 }
13945 pub fn gas_object(&self) -> &super::ChangedObject {
13947 self.gas_object
13948 .as_ref()
13949 .map(|field| field as _)
13950 .unwrap_or_else(|| super::ChangedObject::default_instance() as _)
13951 }
13952 pub fn gas_object_opt_mut(&mut self) -> Option<&mut super::ChangedObject> {
13954 self.gas_object.as_mut().map(|field| field as _)
13955 }
13956 pub fn gas_object_mut(&mut self) -> &mut super::ChangedObject {
13959 self.gas_object.get_or_insert_default()
13960 }
13961 pub fn gas_object_opt(&self) -> Option<&super::ChangedObject> {
13963 self.gas_object.as_ref().map(|field| field as _)
13964 }
13965 pub fn set_gas_object<T: Into<super::ChangedObject>>(&mut self, field: T) {
13967 self.gas_object = Some(field.into().into());
13968 }
13969 pub fn with_gas_object<T: Into<super::ChangedObject>>(
13971 mut self,
13972 field: T,
13973 ) -> Self {
13974 self.set_gas_object(field.into());
13975 self
13976 }
13977 pub fn events_digest_opt_mut(&mut self) -> Option<&mut String> {
13979 self.events_digest.as_mut().map(|field| field as _)
13980 }
13981 pub fn events_digest_mut(&mut self) -> &mut String {
13984 self.events_digest.get_or_insert_default()
13985 }
13986 pub fn events_digest_opt(&self) -> Option<&str> {
13988 self.events_digest.as_ref().map(|field| field as _)
13989 }
13990 pub fn set_events_digest<T: Into<String>>(&mut self, field: T) {
13992 self.events_digest = Some(field.into().into());
13993 }
13994 pub fn with_events_digest<T: Into<String>>(mut self, field: T) -> Self {
13996 self.set_events_digest(field.into());
13997 self
13998 }
13999 pub fn dependencies(&self) -> &[String] {
14001 &self.dependencies
14002 }
14003 pub fn dependencies_mut(&mut self) -> &mut Vec<String> {
14006 &mut self.dependencies
14007 }
14008 pub fn set_dependencies(&mut self, field: Vec<String>) {
14010 self.dependencies = field;
14011 }
14012 pub fn with_dependencies(mut self, field: Vec<String>) -> Self {
14014 self.set_dependencies(field);
14015 self
14016 }
14017 pub fn lamport_version_opt_mut(&mut self) -> Option<&mut u64> {
14019 self.lamport_version.as_mut().map(|field| field as _)
14020 }
14021 pub fn lamport_version_mut(&mut self) -> &mut u64 {
14024 self.lamport_version.get_or_insert_default()
14025 }
14026 pub fn lamport_version_opt(&self) -> Option<u64> {
14028 self.lamport_version.as_ref().map(|field| *field)
14029 }
14030 pub fn set_lamport_version<T: Into<u64>>(&mut self, field: T) {
14032 self.lamport_version = Some(field.into().into());
14033 }
14034 pub fn with_lamport_version<T: Into<u64>>(mut self, field: T) -> Self {
14036 self.set_lamport_version(field.into());
14037 self
14038 }
14039 pub fn changed_objects(&self) -> &[super::ChangedObject] {
14041 &self.changed_objects
14042 }
14043 pub fn changed_objects_mut(&mut self) -> &mut Vec<super::ChangedObject> {
14046 &mut self.changed_objects
14047 }
14048 pub fn set_changed_objects(&mut self, field: Vec<super::ChangedObject>) {
14050 self.changed_objects = field;
14051 }
14052 pub fn with_changed_objects(mut self, field: Vec<super::ChangedObject>) -> Self {
14054 self.set_changed_objects(field);
14055 self
14056 }
14057 pub fn unchanged_consensus_objects(&self) -> &[super::UnchangedConsensusObject] {
14059 &self.unchanged_consensus_objects
14060 }
14061 pub fn unchanged_consensus_objects_mut(
14064 &mut self,
14065 ) -> &mut Vec<super::UnchangedConsensusObject> {
14066 &mut self.unchanged_consensus_objects
14067 }
14068 pub fn set_unchanged_consensus_objects(
14070 &mut self,
14071 field: Vec<super::UnchangedConsensusObject>,
14072 ) {
14073 self.unchanged_consensus_objects = field;
14074 }
14075 pub fn with_unchanged_consensus_objects(
14077 mut self,
14078 field: Vec<super::UnchangedConsensusObject>,
14079 ) -> Self {
14080 self.set_unchanged_consensus_objects(field);
14081 self
14082 }
14083 pub fn auxiliary_data_digest_opt_mut(&mut self) -> Option<&mut String> {
14085 self.auxiliary_data_digest.as_mut().map(|field| field as _)
14086 }
14087 pub fn auxiliary_data_digest_mut(&mut self) -> &mut String {
14090 self.auxiliary_data_digest.get_or_insert_default()
14091 }
14092 pub fn auxiliary_data_digest_opt(&self) -> Option<&str> {
14094 self.auxiliary_data_digest.as_ref().map(|field| field as _)
14095 }
14096 pub fn set_auxiliary_data_digest<T: Into<String>>(&mut self, field: T) {
14098 self.auxiliary_data_digest = Some(field.into().into());
14099 }
14100 pub fn with_auxiliary_data_digest<T: Into<String>>(mut self, field: T) -> Self {
14102 self.set_auxiliary_data_digest(field.into());
14103 self
14104 }
14105 }
14106 impl super::TransactionEvents {
14107 pub const fn const_default() -> Self {
14108 Self {
14109 bcs: None,
14110 digest: None,
14111 events: Vec::new(),
14112 }
14113 }
14114 #[doc(hidden)]
14115 pub fn default_instance() -> &'static Self {
14116 static DEFAULT: super::TransactionEvents = super::TransactionEvents::const_default();
14117 &DEFAULT
14118 }
14119 pub fn bcs(&self) -> &super::Bcs {
14121 self.bcs
14122 .as_ref()
14123 .map(|field| field as _)
14124 .unwrap_or_else(|| super::Bcs::default_instance() as _)
14125 }
14126 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
14128 self.bcs.as_mut().map(|field| field as _)
14129 }
14130 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
14133 self.bcs.get_or_insert_default()
14134 }
14135 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
14137 self.bcs.as_ref().map(|field| field as _)
14138 }
14139 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
14141 self.bcs = Some(field.into().into());
14142 }
14143 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
14145 self.set_bcs(field.into());
14146 self
14147 }
14148 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
14150 self.digest.as_mut().map(|field| field as _)
14151 }
14152 pub fn digest_mut(&mut self) -> &mut String {
14155 self.digest.get_or_insert_default()
14156 }
14157 pub fn digest_opt(&self) -> Option<&str> {
14159 self.digest.as_ref().map(|field| field as _)
14160 }
14161 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
14163 self.digest = Some(field.into().into());
14164 }
14165 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
14167 self.set_digest(field.into());
14168 self
14169 }
14170 pub fn events(&self) -> &[super::Event] {
14172 &self.events
14173 }
14174 pub fn events_mut(&mut self) -> &mut Vec<super::Event> {
14177 &mut self.events
14178 }
14179 pub fn set_events(&mut self, field: Vec<super::Event>) {
14181 self.events = field;
14182 }
14183 pub fn with_events(mut self, field: Vec<super::Event>) -> Self {
14185 self.set_events(field);
14186 self
14187 }
14188 }
14189 impl super::TransactionExpiration {
14190 pub const fn const_default() -> Self {
14191 Self { kind: None, epoch: None }
14192 }
14193 #[doc(hidden)]
14194 pub fn default_instance() -> &'static Self {
14195 static DEFAULT: super::TransactionExpiration = super::TransactionExpiration::const_default();
14196 &DEFAULT
14197 }
14198 pub fn with_kind<
14200 T: Into<super::transaction_expiration::TransactionExpirationKind>,
14201 >(mut self, field: T) -> Self {
14202 self.set_kind(field.into());
14203 self
14204 }
14205 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
14207 self.epoch.as_mut().map(|field| field as _)
14208 }
14209 pub fn epoch_mut(&mut self) -> &mut u64 {
14212 self.epoch.get_or_insert_default()
14213 }
14214 pub fn epoch_opt(&self) -> Option<u64> {
14216 self.epoch.as_ref().map(|field| *field)
14217 }
14218 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
14220 self.epoch = Some(field.into().into());
14221 }
14222 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
14224 self.set_epoch(field.into());
14225 self
14226 }
14227 }
14228 impl super::TransactionFinality {
14229 pub const fn const_default() -> Self {
14230 Self { finality: None }
14231 }
14232 #[doc(hidden)]
14233 pub fn default_instance() -> &'static Self {
14234 static DEFAULT: super::TransactionFinality = super::TransactionFinality::const_default();
14235 &DEFAULT
14236 }
14237 pub fn certified(&self) -> &super::ValidatorAggregatedSignature {
14239 if let Some(super::transaction_finality::Finality::Certified(field)) = &self
14240 .finality
14241 {
14242 field as _
14243 } else {
14244 super::ValidatorAggregatedSignature::default_instance() as _
14245 }
14246 }
14247 pub fn certified_opt(&self) -> Option<&super::ValidatorAggregatedSignature> {
14249 if let Some(super::transaction_finality::Finality::Certified(field)) = &self
14250 .finality
14251 {
14252 Some(field as _)
14253 } else {
14254 None
14255 }
14256 }
14257 pub fn certified_opt_mut(
14259 &mut self,
14260 ) -> Option<&mut super::ValidatorAggregatedSignature> {
14261 if let Some(super::transaction_finality::Finality::Certified(field)) = &mut self
14262 .finality
14263 {
14264 Some(field as _)
14265 } else {
14266 None
14267 }
14268 }
14269 pub fn certified_mut(&mut self) -> &mut super::ValidatorAggregatedSignature {
14273 if self.certified_opt_mut().is_none() {
14274 self.finality = Some(
14275 super::transaction_finality::Finality::Certified(
14276 super::ValidatorAggregatedSignature::default(),
14277 ),
14278 );
14279 }
14280 self.certified_opt_mut().unwrap()
14281 }
14282 pub fn set_certified<T: Into<super::ValidatorAggregatedSignature>>(
14285 &mut self,
14286 field: T,
14287 ) {
14288 self.finality = Some(
14289 super::transaction_finality::Finality::Certified(field.into().into()),
14290 );
14291 }
14292 pub fn with_certified<T: Into<super::ValidatorAggregatedSignature>>(
14295 mut self,
14296 field: T,
14297 ) -> Self {
14298 self.set_certified(field.into());
14299 self
14300 }
14301 pub fn checkpointed(&self) -> u64 {
14303 if let Some(super::transaction_finality::Finality::Checkpointed(field)) = &self
14304 .finality
14305 {
14306 *field
14307 } else {
14308 0u64
14309 }
14310 }
14311 pub fn checkpointed_opt(&self) -> Option<u64> {
14313 if let Some(super::transaction_finality::Finality::Checkpointed(field)) = &self
14314 .finality
14315 {
14316 Some(*field)
14317 } else {
14318 None
14319 }
14320 }
14321 pub fn checkpointed_opt_mut(&mut self) -> Option<&mut u64> {
14323 if let Some(super::transaction_finality::Finality::Checkpointed(field)) = &mut self
14324 .finality
14325 {
14326 Some(field as _)
14327 } else {
14328 None
14329 }
14330 }
14331 pub fn checkpointed_mut(&mut self) -> &mut u64 {
14335 if self.checkpointed_opt_mut().is_none() {
14336 self.finality = Some(
14337 super::transaction_finality::Finality::Checkpointed(u64::default()),
14338 );
14339 }
14340 self.checkpointed_opt_mut().unwrap()
14341 }
14342 pub fn set_checkpointed<T: Into<u64>>(&mut self, field: T) {
14345 self.finality = Some(
14346 super::transaction_finality::Finality::Checkpointed(field.into().into()),
14347 );
14348 }
14349 pub fn with_checkpointed<T: Into<u64>>(mut self, field: T) -> Self {
14352 self.set_checkpointed(field.into());
14353 self
14354 }
14355 }
14356 impl super::TransactionKind {
14357 pub const fn const_default() -> Self {
14358 Self { kind: None }
14359 }
14360 #[doc(hidden)]
14361 pub fn default_instance() -> &'static Self {
14362 static DEFAULT: super::TransactionKind = super::TransactionKind::const_default();
14363 &DEFAULT
14364 }
14365 pub fn programmable_transaction(&self) -> &super::ProgrammableTransaction {
14367 if let Some(super::transaction_kind::Kind::ProgrammableTransaction(field)) = &self
14368 .kind
14369 {
14370 field as _
14371 } else {
14372 super::ProgrammableTransaction::default_instance() as _
14373 }
14374 }
14375 pub fn programmable_transaction_opt(
14377 &self,
14378 ) -> Option<&super::ProgrammableTransaction> {
14379 if let Some(super::transaction_kind::Kind::ProgrammableTransaction(field)) = &self
14380 .kind
14381 {
14382 Some(field as _)
14383 } else {
14384 None
14385 }
14386 }
14387 pub fn programmable_transaction_opt_mut(
14389 &mut self,
14390 ) -> Option<&mut super::ProgrammableTransaction> {
14391 if let Some(super::transaction_kind::Kind::ProgrammableTransaction(field)) = &mut self
14392 .kind
14393 {
14394 Some(field as _)
14395 } else {
14396 None
14397 }
14398 }
14399 pub fn programmable_transaction_mut(
14403 &mut self,
14404 ) -> &mut super::ProgrammableTransaction {
14405 if self.programmable_transaction_opt_mut().is_none() {
14406 self.kind = Some(
14407 super::transaction_kind::Kind::ProgrammableTransaction(
14408 super::ProgrammableTransaction::default(),
14409 ),
14410 );
14411 }
14412 self.programmable_transaction_opt_mut().unwrap()
14413 }
14414 pub fn set_programmable_transaction<T: Into<super::ProgrammableTransaction>>(
14417 &mut self,
14418 field: T,
14419 ) {
14420 self.kind = Some(
14421 super::transaction_kind::Kind::ProgrammableTransaction(
14422 field.into().into(),
14423 ),
14424 );
14425 }
14426 pub fn with_programmable_transaction<T: Into<super::ProgrammableTransaction>>(
14429 mut self,
14430 field: T,
14431 ) -> Self {
14432 self.set_programmable_transaction(field.into());
14433 self
14434 }
14435 pub fn programmable_system_transaction(
14437 &self,
14438 ) -> &super::ProgrammableTransaction {
14439 if let Some(
14440 super::transaction_kind::Kind::ProgrammableSystemTransaction(field),
14441 ) = &self.kind
14442 {
14443 field as _
14444 } else {
14445 super::ProgrammableTransaction::default_instance() as _
14446 }
14447 }
14448 pub fn programmable_system_transaction_opt(
14450 &self,
14451 ) -> Option<&super::ProgrammableTransaction> {
14452 if let Some(
14453 super::transaction_kind::Kind::ProgrammableSystemTransaction(field),
14454 ) = &self.kind
14455 {
14456 Some(field as _)
14457 } else {
14458 None
14459 }
14460 }
14461 pub fn programmable_system_transaction_opt_mut(
14463 &mut self,
14464 ) -> Option<&mut super::ProgrammableTransaction> {
14465 if let Some(
14466 super::transaction_kind::Kind::ProgrammableSystemTransaction(field),
14467 ) = &mut self.kind
14468 {
14469 Some(field as _)
14470 } else {
14471 None
14472 }
14473 }
14474 pub fn programmable_system_transaction_mut(
14478 &mut self,
14479 ) -> &mut super::ProgrammableTransaction {
14480 if self.programmable_system_transaction_opt_mut().is_none() {
14481 self.kind = Some(
14482 super::transaction_kind::Kind::ProgrammableSystemTransaction(
14483 super::ProgrammableTransaction::default(),
14484 ),
14485 );
14486 }
14487 self.programmable_system_transaction_opt_mut().unwrap()
14488 }
14489 pub fn set_programmable_system_transaction<
14492 T: Into<super::ProgrammableTransaction>,
14493 >(&mut self, field: T) {
14494 self.kind = Some(
14495 super::transaction_kind::Kind::ProgrammableSystemTransaction(
14496 field.into().into(),
14497 ),
14498 );
14499 }
14500 pub fn with_programmable_system_transaction<
14503 T: Into<super::ProgrammableTransaction>,
14504 >(mut self, field: T) -> Self {
14505 self.set_programmable_system_transaction(field.into());
14506 self
14507 }
14508 pub fn change_epoch(&self) -> &super::ChangeEpoch {
14510 if let Some(super::transaction_kind::Kind::ChangeEpoch(field)) = &self.kind {
14511 field as _
14512 } else {
14513 super::ChangeEpoch::default_instance() as _
14514 }
14515 }
14516 pub fn change_epoch_opt(&self) -> Option<&super::ChangeEpoch> {
14518 if let Some(super::transaction_kind::Kind::ChangeEpoch(field)) = &self.kind {
14519 Some(field as _)
14520 } else {
14521 None
14522 }
14523 }
14524 pub fn change_epoch_opt_mut(&mut self) -> Option<&mut super::ChangeEpoch> {
14526 if let Some(super::transaction_kind::Kind::ChangeEpoch(field)) = &mut self
14527 .kind
14528 {
14529 Some(field as _)
14530 } else {
14531 None
14532 }
14533 }
14534 pub fn change_epoch_mut(&mut self) -> &mut super::ChangeEpoch {
14538 if self.change_epoch_opt_mut().is_none() {
14539 self.kind = Some(
14540 super::transaction_kind::Kind::ChangeEpoch(
14541 super::ChangeEpoch::default(),
14542 ),
14543 );
14544 }
14545 self.change_epoch_opt_mut().unwrap()
14546 }
14547 pub fn set_change_epoch<T: Into<super::ChangeEpoch>>(&mut self, field: T) {
14550 self.kind = Some(
14551 super::transaction_kind::Kind::ChangeEpoch(field.into().into()),
14552 );
14553 }
14554 pub fn with_change_epoch<T: Into<super::ChangeEpoch>>(
14557 mut self,
14558 field: T,
14559 ) -> Self {
14560 self.set_change_epoch(field.into());
14561 self
14562 }
14563 pub fn genesis(&self) -> &super::GenesisTransaction {
14565 if let Some(super::transaction_kind::Kind::Genesis(field)) = &self.kind {
14566 field as _
14567 } else {
14568 super::GenesisTransaction::default_instance() as _
14569 }
14570 }
14571 pub fn genesis_opt(&self) -> Option<&super::GenesisTransaction> {
14573 if let Some(super::transaction_kind::Kind::Genesis(field)) = &self.kind {
14574 Some(field as _)
14575 } else {
14576 None
14577 }
14578 }
14579 pub fn genesis_opt_mut(&mut self) -> Option<&mut super::GenesisTransaction> {
14581 if let Some(super::transaction_kind::Kind::Genesis(field)) = &mut self.kind {
14582 Some(field as _)
14583 } else {
14584 None
14585 }
14586 }
14587 pub fn genesis_mut(&mut self) -> &mut super::GenesisTransaction {
14591 if self.genesis_opt_mut().is_none() {
14592 self.kind = Some(
14593 super::transaction_kind::Kind::Genesis(
14594 super::GenesisTransaction::default(),
14595 ),
14596 );
14597 }
14598 self.genesis_opt_mut().unwrap()
14599 }
14600 pub fn set_genesis<T: Into<super::GenesisTransaction>>(&mut self, field: T) {
14603 self.kind = Some(
14604 super::transaction_kind::Kind::Genesis(field.into().into()),
14605 );
14606 }
14607 pub fn with_genesis<T: Into<super::GenesisTransaction>>(
14610 mut self,
14611 field: T,
14612 ) -> Self {
14613 self.set_genesis(field.into());
14614 self
14615 }
14616 pub fn consensus_commit_prologue_v1(&self) -> &super::ConsensusCommitPrologue {
14618 if let Some(
14619 super::transaction_kind::Kind::ConsensusCommitPrologueV1(field),
14620 ) = &self.kind
14621 {
14622 field as _
14623 } else {
14624 super::ConsensusCommitPrologue::default_instance() as _
14625 }
14626 }
14627 pub fn consensus_commit_prologue_v1_opt(
14629 &self,
14630 ) -> Option<&super::ConsensusCommitPrologue> {
14631 if let Some(
14632 super::transaction_kind::Kind::ConsensusCommitPrologueV1(field),
14633 ) = &self.kind
14634 {
14635 Some(field as _)
14636 } else {
14637 None
14638 }
14639 }
14640 pub fn consensus_commit_prologue_v1_opt_mut(
14642 &mut self,
14643 ) -> Option<&mut super::ConsensusCommitPrologue> {
14644 if let Some(
14645 super::transaction_kind::Kind::ConsensusCommitPrologueV1(field),
14646 ) = &mut self.kind
14647 {
14648 Some(field as _)
14649 } else {
14650 None
14651 }
14652 }
14653 pub fn consensus_commit_prologue_v1_mut(
14657 &mut self,
14658 ) -> &mut super::ConsensusCommitPrologue {
14659 if self.consensus_commit_prologue_v1_opt_mut().is_none() {
14660 self.kind = Some(
14661 super::transaction_kind::Kind::ConsensusCommitPrologueV1(
14662 super::ConsensusCommitPrologue::default(),
14663 ),
14664 );
14665 }
14666 self.consensus_commit_prologue_v1_opt_mut().unwrap()
14667 }
14668 pub fn set_consensus_commit_prologue_v1<T: Into<super::ConsensusCommitPrologue>>(
14671 &mut self,
14672 field: T,
14673 ) {
14674 self.kind = Some(
14675 super::transaction_kind::Kind::ConsensusCommitPrologueV1(
14676 field.into().into(),
14677 ),
14678 );
14679 }
14680 pub fn with_consensus_commit_prologue_v1<
14683 T: Into<super::ConsensusCommitPrologue>,
14684 >(mut self, field: T) -> Self {
14685 self.set_consensus_commit_prologue_v1(field.into());
14686 self
14687 }
14688 pub fn authenticator_state_update(&self) -> &super::AuthenticatorStateUpdate {
14690 if let Some(
14691 super::transaction_kind::Kind::AuthenticatorStateUpdate(field),
14692 ) = &self.kind
14693 {
14694 field as _
14695 } else {
14696 super::AuthenticatorStateUpdate::default_instance() as _
14697 }
14698 }
14699 pub fn authenticator_state_update_opt(
14701 &self,
14702 ) -> Option<&super::AuthenticatorStateUpdate> {
14703 if let Some(
14704 super::transaction_kind::Kind::AuthenticatorStateUpdate(field),
14705 ) = &self.kind
14706 {
14707 Some(field as _)
14708 } else {
14709 None
14710 }
14711 }
14712 pub fn authenticator_state_update_opt_mut(
14714 &mut self,
14715 ) -> Option<&mut super::AuthenticatorStateUpdate> {
14716 if let Some(
14717 super::transaction_kind::Kind::AuthenticatorStateUpdate(field),
14718 ) = &mut self.kind
14719 {
14720 Some(field as _)
14721 } else {
14722 None
14723 }
14724 }
14725 pub fn authenticator_state_update_mut(
14729 &mut self,
14730 ) -> &mut super::AuthenticatorStateUpdate {
14731 if self.authenticator_state_update_opt_mut().is_none() {
14732 self.kind = Some(
14733 super::transaction_kind::Kind::AuthenticatorStateUpdate(
14734 super::AuthenticatorStateUpdate::default(),
14735 ),
14736 );
14737 }
14738 self.authenticator_state_update_opt_mut().unwrap()
14739 }
14740 pub fn set_authenticator_state_update<T: Into<super::AuthenticatorStateUpdate>>(
14743 &mut self,
14744 field: T,
14745 ) {
14746 self.kind = Some(
14747 super::transaction_kind::Kind::AuthenticatorStateUpdate(
14748 field.into().into(),
14749 ),
14750 );
14751 }
14752 pub fn with_authenticator_state_update<T: Into<super::AuthenticatorStateUpdate>>(
14755 mut self,
14756 field: T,
14757 ) -> Self {
14758 self.set_authenticator_state_update(field.into());
14759 self
14760 }
14761 pub fn end_of_epoch(&self) -> &super::EndOfEpochTransaction {
14763 if let Some(super::transaction_kind::Kind::EndOfEpoch(field)) = &self.kind {
14764 field as _
14765 } else {
14766 super::EndOfEpochTransaction::default_instance() as _
14767 }
14768 }
14769 pub fn end_of_epoch_opt(&self) -> Option<&super::EndOfEpochTransaction> {
14771 if let Some(super::transaction_kind::Kind::EndOfEpoch(field)) = &self.kind {
14772 Some(field as _)
14773 } else {
14774 None
14775 }
14776 }
14777 pub fn end_of_epoch_opt_mut(
14779 &mut self,
14780 ) -> Option<&mut super::EndOfEpochTransaction> {
14781 if let Some(super::transaction_kind::Kind::EndOfEpoch(field)) = &mut self
14782 .kind
14783 {
14784 Some(field as _)
14785 } else {
14786 None
14787 }
14788 }
14789 pub fn end_of_epoch_mut(&mut self) -> &mut super::EndOfEpochTransaction {
14793 if self.end_of_epoch_opt_mut().is_none() {
14794 self.kind = Some(
14795 super::transaction_kind::Kind::EndOfEpoch(
14796 super::EndOfEpochTransaction::default(),
14797 ),
14798 );
14799 }
14800 self.end_of_epoch_opt_mut().unwrap()
14801 }
14802 pub fn set_end_of_epoch<T: Into<super::EndOfEpochTransaction>>(
14805 &mut self,
14806 field: T,
14807 ) {
14808 self.kind = Some(
14809 super::transaction_kind::Kind::EndOfEpoch(field.into().into()),
14810 );
14811 }
14812 pub fn with_end_of_epoch<T: Into<super::EndOfEpochTransaction>>(
14815 mut self,
14816 field: T,
14817 ) -> Self {
14818 self.set_end_of_epoch(field.into());
14819 self
14820 }
14821 pub fn randomness_state_update(&self) -> &super::RandomnessStateUpdate {
14823 if let Some(super::transaction_kind::Kind::RandomnessStateUpdate(field)) = &self
14824 .kind
14825 {
14826 field as _
14827 } else {
14828 super::RandomnessStateUpdate::default_instance() as _
14829 }
14830 }
14831 pub fn randomness_state_update_opt(
14833 &self,
14834 ) -> Option<&super::RandomnessStateUpdate> {
14835 if let Some(super::transaction_kind::Kind::RandomnessStateUpdate(field)) = &self
14836 .kind
14837 {
14838 Some(field as _)
14839 } else {
14840 None
14841 }
14842 }
14843 pub fn randomness_state_update_opt_mut(
14845 &mut self,
14846 ) -> Option<&mut super::RandomnessStateUpdate> {
14847 if let Some(super::transaction_kind::Kind::RandomnessStateUpdate(field)) = &mut self
14848 .kind
14849 {
14850 Some(field as _)
14851 } else {
14852 None
14853 }
14854 }
14855 pub fn randomness_state_update_mut(
14859 &mut self,
14860 ) -> &mut super::RandomnessStateUpdate {
14861 if self.randomness_state_update_opt_mut().is_none() {
14862 self.kind = Some(
14863 super::transaction_kind::Kind::RandomnessStateUpdate(
14864 super::RandomnessStateUpdate::default(),
14865 ),
14866 );
14867 }
14868 self.randomness_state_update_opt_mut().unwrap()
14869 }
14870 pub fn set_randomness_state_update<T: Into<super::RandomnessStateUpdate>>(
14873 &mut self,
14874 field: T,
14875 ) {
14876 self.kind = Some(
14877 super::transaction_kind::Kind::RandomnessStateUpdate(field.into().into()),
14878 );
14879 }
14880 pub fn with_randomness_state_update<T: Into<super::RandomnessStateUpdate>>(
14883 mut self,
14884 field: T,
14885 ) -> Self {
14886 self.set_randomness_state_update(field.into());
14887 self
14888 }
14889 pub fn consensus_commit_prologue_v2(&self) -> &super::ConsensusCommitPrologue {
14891 if let Some(
14892 super::transaction_kind::Kind::ConsensusCommitPrologueV2(field),
14893 ) = &self.kind
14894 {
14895 field as _
14896 } else {
14897 super::ConsensusCommitPrologue::default_instance() as _
14898 }
14899 }
14900 pub fn consensus_commit_prologue_v2_opt(
14902 &self,
14903 ) -> Option<&super::ConsensusCommitPrologue> {
14904 if let Some(
14905 super::transaction_kind::Kind::ConsensusCommitPrologueV2(field),
14906 ) = &self.kind
14907 {
14908 Some(field as _)
14909 } else {
14910 None
14911 }
14912 }
14913 pub fn consensus_commit_prologue_v2_opt_mut(
14915 &mut self,
14916 ) -> Option<&mut super::ConsensusCommitPrologue> {
14917 if let Some(
14918 super::transaction_kind::Kind::ConsensusCommitPrologueV2(field),
14919 ) = &mut self.kind
14920 {
14921 Some(field as _)
14922 } else {
14923 None
14924 }
14925 }
14926 pub fn consensus_commit_prologue_v2_mut(
14930 &mut self,
14931 ) -> &mut super::ConsensusCommitPrologue {
14932 if self.consensus_commit_prologue_v2_opt_mut().is_none() {
14933 self.kind = Some(
14934 super::transaction_kind::Kind::ConsensusCommitPrologueV2(
14935 super::ConsensusCommitPrologue::default(),
14936 ),
14937 );
14938 }
14939 self.consensus_commit_prologue_v2_opt_mut().unwrap()
14940 }
14941 pub fn set_consensus_commit_prologue_v2<T: Into<super::ConsensusCommitPrologue>>(
14944 &mut self,
14945 field: T,
14946 ) {
14947 self.kind = Some(
14948 super::transaction_kind::Kind::ConsensusCommitPrologueV2(
14949 field.into().into(),
14950 ),
14951 );
14952 }
14953 pub fn with_consensus_commit_prologue_v2<
14956 T: Into<super::ConsensusCommitPrologue>,
14957 >(mut self, field: T) -> Self {
14958 self.set_consensus_commit_prologue_v2(field.into());
14959 self
14960 }
14961 pub fn consensus_commit_prologue_v3(&self) -> &super::ConsensusCommitPrologue {
14963 if let Some(
14964 super::transaction_kind::Kind::ConsensusCommitPrologueV3(field),
14965 ) = &self.kind
14966 {
14967 field as _
14968 } else {
14969 super::ConsensusCommitPrologue::default_instance() as _
14970 }
14971 }
14972 pub fn consensus_commit_prologue_v3_opt(
14974 &self,
14975 ) -> Option<&super::ConsensusCommitPrologue> {
14976 if let Some(
14977 super::transaction_kind::Kind::ConsensusCommitPrologueV3(field),
14978 ) = &self.kind
14979 {
14980 Some(field as _)
14981 } else {
14982 None
14983 }
14984 }
14985 pub fn consensus_commit_prologue_v3_opt_mut(
14987 &mut self,
14988 ) -> Option<&mut super::ConsensusCommitPrologue> {
14989 if let Some(
14990 super::transaction_kind::Kind::ConsensusCommitPrologueV3(field),
14991 ) = &mut self.kind
14992 {
14993 Some(field as _)
14994 } else {
14995 None
14996 }
14997 }
14998 pub fn consensus_commit_prologue_v3_mut(
15002 &mut self,
15003 ) -> &mut super::ConsensusCommitPrologue {
15004 if self.consensus_commit_prologue_v3_opt_mut().is_none() {
15005 self.kind = Some(
15006 super::transaction_kind::Kind::ConsensusCommitPrologueV3(
15007 super::ConsensusCommitPrologue::default(),
15008 ),
15009 );
15010 }
15011 self.consensus_commit_prologue_v3_opt_mut().unwrap()
15012 }
15013 pub fn set_consensus_commit_prologue_v3<T: Into<super::ConsensusCommitPrologue>>(
15016 &mut self,
15017 field: T,
15018 ) {
15019 self.kind = Some(
15020 super::transaction_kind::Kind::ConsensusCommitPrologueV3(
15021 field.into().into(),
15022 ),
15023 );
15024 }
15025 pub fn with_consensus_commit_prologue_v3<
15028 T: Into<super::ConsensusCommitPrologue>,
15029 >(mut self, field: T) -> Self {
15030 self.set_consensus_commit_prologue_v3(field.into());
15031 self
15032 }
15033 pub fn consensus_commit_prologue_v4(&self) -> &super::ConsensusCommitPrologue {
15035 if let Some(
15036 super::transaction_kind::Kind::ConsensusCommitPrologueV4(field),
15037 ) = &self.kind
15038 {
15039 field as _
15040 } else {
15041 super::ConsensusCommitPrologue::default_instance() as _
15042 }
15043 }
15044 pub fn consensus_commit_prologue_v4_opt(
15046 &self,
15047 ) -> Option<&super::ConsensusCommitPrologue> {
15048 if let Some(
15049 super::transaction_kind::Kind::ConsensusCommitPrologueV4(field),
15050 ) = &self.kind
15051 {
15052 Some(field as _)
15053 } else {
15054 None
15055 }
15056 }
15057 pub fn consensus_commit_prologue_v4_opt_mut(
15059 &mut self,
15060 ) -> Option<&mut super::ConsensusCommitPrologue> {
15061 if let Some(
15062 super::transaction_kind::Kind::ConsensusCommitPrologueV4(field),
15063 ) = &mut self.kind
15064 {
15065 Some(field as _)
15066 } else {
15067 None
15068 }
15069 }
15070 pub fn consensus_commit_prologue_v4_mut(
15074 &mut self,
15075 ) -> &mut super::ConsensusCommitPrologue {
15076 if self.consensus_commit_prologue_v4_opt_mut().is_none() {
15077 self.kind = Some(
15078 super::transaction_kind::Kind::ConsensusCommitPrologueV4(
15079 super::ConsensusCommitPrologue::default(),
15080 ),
15081 );
15082 }
15083 self.consensus_commit_prologue_v4_opt_mut().unwrap()
15084 }
15085 pub fn set_consensus_commit_prologue_v4<T: Into<super::ConsensusCommitPrologue>>(
15088 &mut self,
15089 field: T,
15090 ) {
15091 self.kind = Some(
15092 super::transaction_kind::Kind::ConsensusCommitPrologueV4(
15093 field.into().into(),
15094 ),
15095 );
15096 }
15097 pub fn with_consensus_commit_prologue_v4<
15100 T: Into<super::ConsensusCommitPrologue>,
15101 >(mut self, field: T) -> Self {
15102 self.set_consensus_commit_prologue_v4(field.into());
15103 self
15104 }
15105 }
15106 impl super::TransferObjects {
15107 pub const fn const_default() -> Self {
15108 Self {
15109 objects: Vec::new(),
15110 address: None,
15111 }
15112 }
15113 #[doc(hidden)]
15114 pub fn default_instance() -> &'static Self {
15115 static DEFAULT: super::TransferObjects = super::TransferObjects::const_default();
15116 &DEFAULT
15117 }
15118 pub fn objects(&self) -> &[super::Argument] {
15120 &self.objects
15121 }
15122 pub fn objects_mut(&mut self) -> &mut Vec<super::Argument> {
15125 &mut self.objects
15126 }
15127 pub fn set_objects(&mut self, field: Vec<super::Argument>) {
15129 self.objects = field;
15130 }
15131 pub fn with_objects(mut self, field: Vec<super::Argument>) -> Self {
15133 self.set_objects(field);
15134 self
15135 }
15136 pub fn address(&self) -> &super::Argument {
15138 self.address
15139 .as_ref()
15140 .map(|field| field as _)
15141 .unwrap_or_else(|| super::Argument::default_instance() as _)
15142 }
15143 pub fn address_opt_mut(&mut self) -> Option<&mut super::Argument> {
15145 self.address.as_mut().map(|field| field as _)
15146 }
15147 pub fn address_mut(&mut self) -> &mut super::Argument {
15150 self.address.get_or_insert_default()
15151 }
15152 pub fn address_opt(&self) -> Option<&super::Argument> {
15154 self.address.as_ref().map(|field| field as _)
15155 }
15156 pub fn set_address<T: Into<super::Argument>>(&mut self, field: T) {
15158 self.address = Some(field.into().into());
15159 }
15160 pub fn with_address<T: Into<super::Argument>>(mut self, field: T) -> Self {
15162 self.set_address(field.into());
15163 self
15164 }
15165 }
15166 impl super::TypeArgumentError {
15167 pub const fn const_default() -> Self {
15168 Self {
15169 type_argument: None,
15170 kind: None,
15171 }
15172 }
15173 #[doc(hidden)]
15174 pub fn default_instance() -> &'static Self {
15175 static DEFAULT: super::TypeArgumentError = super::TypeArgumentError::const_default();
15176 &DEFAULT
15177 }
15178 pub fn type_argument_opt_mut(&mut self) -> Option<&mut u32> {
15180 self.type_argument.as_mut().map(|field| field as _)
15181 }
15182 pub fn type_argument_mut(&mut self) -> &mut u32 {
15185 self.type_argument.get_or_insert_default()
15186 }
15187 pub fn type_argument_opt(&self) -> Option<u32> {
15189 self.type_argument.as_ref().map(|field| *field)
15190 }
15191 pub fn set_type_argument<T: Into<u32>>(&mut self, field: T) {
15193 self.type_argument = Some(field.into().into());
15194 }
15195 pub fn with_type_argument<T: Into<u32>>(mut self, field: T) -> Self {
15197 self.set_type_argument(field.into());
15198 self
15199 }
15200 pub fn with_kind<T: Into<super::type_argument_error::TypeArgumentErrorKind>>(
15202 mut self,
15203 field: T,
15204 ) -> Self {
15205 self.set_kind(field.into());
15206 self
15207 }
15208 }
15209 impl super::TypeOrigin {
15210 pub const fn const_default() -> Self {
15211 Self {
15212 module_name: None,
15213 datatype_name: None,
15214 package_id: None,
15215 }
15216 }
15217 #[doc(hidden)]
15218 pub fn default_instance() -> &'static Self {
15219 static DEFAULT: super::TypeOrigin = super::TypeOrigin::const_default();
15220 &DEFAULT
15221 }
15222 pub fn module_name_opt_mut(&mut self) -> Option<&mut String> {
15224 self.module_name.as_mut().map(|field| field as _)
15225 }
15226 pub fn module_name_mut(&mut self) -> &mut String {
15229 self.module_name.get_or_insert_default()
15230 }
15231 pub fn module_name_opt(&self) -> Option<&str> {
15233 self.module_name.as_ref().map(|field| field as _)
15234 }
15235 pub fn set_module_name<T: Into<String>>(&mut self, field: T) {
15237 self.module_name = Some(field.into().into());
15238 }
15239 pub fn with_module_name<T: Into<String>>(mut self, field: T) -> Self {
15241 self.set_module_name(field.into());
15242 self
15243 }
15244 pub fn datatype_name_opt_mut(&mut self) -> Option<&mut String> {
15246 self.datatype_name.as_mut().map(|field| field as _)
15247 }
15248 pub fn datatype_name_mut(&mut self) -> &mut String {
15251 self.datatype_name.get_or_insert_default()
15252 }
15253 pub fn datatype_name_opt(&self) -> Option<&str> {
15255 self.datatype_name.as_ref().map(|field| field as _)
15256 }
15257 pub fn set_datatype_name<T: Into<String>>(&mut self, field: T) {
15259 self.datatype_name = Some(field.into().into());
15260 }
15261 pub fn with_datatype_name<T: Into<String>>(mut self, field: T) -> Self {
15263 self.set_datatype_name(field.into());
15264 self
15265 }
15266 pub fn package_id_opt_mut(&mut self) -> Option<&mut String> {
15268 self.package_id.as_mut().map(|field| field as _)
15269 }
15270 pub fn package_id_mut(&mut self) -> &mut String {
15273 self.package_id.get_or_insert_default()
15274 }
15275 pub fn package_id_opt(&self) -> Option<&str> {
15277 self.package_id.as_ref().map(|field| field as _)
15278 }
15279 pub fn set_package_id<T: Into<String>>(&mut self, field: T) {
15281 self.package_id = Some(field.into().into());
15282 }
15283 pub fn with_package_id<T: Into<String>>(mut self, field: T) -> Self {
15285 self.set_package_id(field.into());
15286 self
15287 }
15288 }
15289 impl super::TypeParameter {
15290 pub const fn const_default() -> Self {
15291 Self {
15292 constraints: Vec::new(),
15293 is_phantom: None,
15294 }
15295 }
15296 #[doc(hidden)]
15297 pub fn default_instance() -> &'static Self {
15298 static DEFAULT: super::TypeParameter = super::TypeParameter::const_default();
15299 &DEFAULT
15300 }
15301 pub fn is_phantom_opt_mut(&mut self) -> Option<&mut bool> {
15303 self.is_phantom.as_mut().map(|field| field as _)
15304 }
15305 pub fn is_phantom_mut(&mut self) -> &mut bool {
15308 self.is_phantom.get_or_insert_default()
15309 }
15310 pub fn is_phantom_opt(&self) -> Option<bool> {
15312 self.is_phantom.as_ref().map(|field| *field)
15313 }
15314 pub fn set_is_phantom<T: Into<bool>>(&mut self, field: T) {
15316 self.is_phantom = Some(field.into().into());
15317 }
15318 pub fn with_is_phantom<T: Into<bool>>(mut self, field: T) -> Self {
15320 self.set_is_phantom(field.into());
15321 self
15322 }
15323 }
15324 impl super::UnchangedConsensusObject {
15325 pub const fn const_default() -> Self {
15326 Self {
15327 kind: None,
15328 object_id: None,
15329 version: None,
15330 digest: None,
15331 object_type: None,
15332 }
15333 }
15334 #[doc(hidden)]
15335 pub fn default_instance() -> &'static Self {
15336 static DEFAULT: super::UnchangedConsensusObject = super::UnchangedConsensusObject::const_default();
15337 &DEFAULT
15338 }
15339 pub fn with_kind<
15341 T: Into<super::unchanged_consensus_object::UnchangedConsensusObjectKind>,
15342 >(mut self, field: T) -> Self {
15343 self.set_kind(field.into());
15344 self
15345 }
15346 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
15348 self.object_id.as_mut().map(|field| field as _)
15349 }
15350 pub fn object_id_mut(&mut self) -> &mut String {
15353 self.object_id.get_or_insert_default()
15354 }
15355 pub fn object_id_opt(&self) -> Option<&str> {
15357 self.object_id.as_ref().map(|field| field as _)
15358 }
15359 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
15361 self.object_id = Some(field.into().into());
15362 }
15363 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
15365 self.set_object_id(field.into());
15366 self
15367 }
15368 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
15370 self.version.as_mut().map(|field| field as _)
15371 }
15372 pub fn version_mut(&mut self) -> &mut u64 {
15375 self.version.get_or_insert_default()
15376 }
15377 pub fn version_opt(&self) -> Option<u64> {
15379 self.version.as_ref().map(|field| *field)
15380 }
15381 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
15383 self.version = Some(field.into().into());
15384 }
15385 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
15387 self.set_version(field.into());
15388 self
15389 }
15390 pub fn digest_opt_mut(&mut self) -> Option<&mut String> {
15392 self.digest.as_mut().map(|field| field as _)
15393 }
15394 pub fn digest_mut(&mut self) -> &mut String {
15397 self.digest.get_or_insert_default()
15398 }
15399 pub fn digest_opt(&self) -> Option<&str> {
15401 self.digest.as_ref().map(|field| field as _)
15402 }
15403 pub fn set_digest<T: Into<String>>(&mut self, field: T) {
15405 self.digest = Some(field.into().into());
15406 }
15407 pub fn with_digest<T: Into<String>>(mut self, field: T) -> Self {
15409 self.set_digest(field.into());
15410 self
15411 }
15412 pub fn object_type_opt_mut(&mut self) -> Option<&mut String> {
15414 self.object_type.as_mut().map(|field| field as _)
15415 }
15416 pub fn object_type_mut(&mut self) -> &mut String {
15419 self.object_type.get_or_insert_default()
15420 }
15421 pub fn object_type_opt(&self) -> Option<&str> {
15423 self.object_type.as_ref().map(|field| field as _)
15424 }
15425 pub fn set_object_type<T: Into<String>>(&mut self, field: T) {
15427 self.object_type = Some(field.into().into());
15428 }
15429 pub fn with_object_type<T: Into<String>>(mut self, field: T) -> Self {
15431 self.set_object_type(field.into());
15432 self
15433 }
15434 }
15435 impl super::Upgrade {
15436 pub const fn const_default() -> Self {
15437 Self {
15438 modules: Vec::new(),
15439 dependencies: Vec::new(),
15440 package: None,
15441 ticket: None,
15442 }
15443 }
15444 #[doc(hidden)]
15445 pub fn default_instance() -> &'static Self {
15446 static DEFAULT: super::Upgrade = super::Upgrade::const_default();
15447 &DEFAULT
15448 }
15449 pub fn modules(&self) -> &[::prost::bytes::Bytes] {
15451 &self.modules
15452 }
15453 pub fn modules_mut(&mut self) -> &mut Vec<::prost::bytes::Bytes> {
15456 &mut self.modules
15457 }
15458 pub fn set_modules(&mut self, field: Vec<::prost::bytes::Bytes>) {
15460 self.modules = field;
15461 }
15462 pub fn with_modules(mut self, field: Vec<::prost::bytes::Bytes>) -> Self {
15464 self.set_modules(field);
15465 self
15466 }
15467 pub fn dependencies(&self) -> &[String] {
15469 &self.dependencies
15470 }
15471 pub fn dependencies_mut(&mut self) -> &mut Vec<String> {
15474 &mut self.dependencies
15475 }
15476 pub fn set_dependencies(&mut self, field: Vec<String>) {
15478 self.dependencies = field;
15479 }
15480 pub fn with_dependencies(mut self, field: Vec<String>) -> Self {
15482 self.set_dependencies(field);
15483 self
15484 }
15485 pub fn package_opt_mut(&mut self) -> Option<&mut String> {
15487 self.package.as_mut().map(|field| field as _)
15488 }
15489 pub fn package_mut(&mut self) -> &mut String {
15492 self.package.get_or_insert_default()
15493 }
15494 pub fn package_opt(&self) -> Option<&str> {
15496 self.package.as_ref().map(|field| field as _)
15497 }
15498 pub fn set_package<T: Into<String>>(&mut self, field: T) {
15500 self.package = Some(field.into().into());
15501 }
15502 pub fn with_package<T: Into<String>>(mut self, field: T) -> Self {
15504 self.set_package(field.into());
15505 self
15506 }
15507 pub fn ticket(&self) -> &super::Argument {
15509 self.ticket
15510 .as_ref()
15511 .map(|field| field as _)
15512 .unwrap_or_else(|| super::Argument::default_instance() as _)
15513 }
15514 pub fn ticket_opt_mut(&mut self) -> Option<&mut super::Argument> {
15516 self.ticket.as_mut().map(|field| field as _)
15517 }
15518 pub fn ticket_mut(&mut self) -> &mut super::Argument {
15521 self.ticket.get_or_insert_default()
15522 }
15523 pub fn ticket_opt(&self) -> Option<&super::Argument> {
15525 self.ticket.as_ref().map(|field| field as _)
15526 }
15527 pub fn set_ticket<T: Into<super::Argument>>(&mut self, field: T) {
15529 self.ticket = Some(field.into().into());
15530 }
15531 pub fn with_ticket<T: Into<super::Argument>>(mut self, field: T) -> Self {
15533 self.set_ticket(field.into());
15534 self
15535 }
15536 }
15537 impl super::UserSignature {
15538 pub const fn const_default() -> Self {
15539 Self {
15540 bcs: None,
15541 scheme: None,
15542 signature: None,
15543 }
15544 }
15545 #[doc(hidden)]
15546 pub fn default_instance() -> &'static Self {
15547 static DEFAULT: super::UserSignature = super::UserSignature::const_default();
15548 &DEFAULT
15549 }
15550 pub fn bcs(&self) -> &super::Bcs {
15552 self.bcs
15553 .as_ref()
15554 .map(|field| field as _)
15555 .unwrap_or_else(|| super::Bcs::default_instance() as _)
15556 }
15557 pub fn bcs_opt_mut(&mut self) -> Option<&mut super::Bcs> {
15559 self.bcs.as_mut().map(|field| field as _)
15560 }
15561 pub fn bcs_mut(&mut self) -> &mut super::Bcs {
15564 self.bcs.get_or_insert_default()
15565 }
15566 pub fn bcs_opt(&self) -> Option<&super::Bcs> {
15568 self.bcs.as_ref().map(|field| field as _)
15569 }
15570 pub fn set_bcs<T: Into<super::Bcs>>(&mut self, field: T) {
15572 self.bcs = Some(field.into().into());
15573 }
15574 pub fn with_bcs<T: Into<super::Bcs>>(mut self, field: T) -> Self {
15576 self.set_bcs(field.into());
15577 self
15578 }
15579 pub fn with_scheme<T: Into<super::SignatureScheme>>(mut self, field: T) -> Self {
15581 self.set_scheme(field.into());
15582 self
15583 }
15584 pub fn simple(&self) -> &super::SimpleSignature {
15586 if let Some(super::user_signature::Signature::Simple(field)) = &self
15587 .signature
15588 {
15589 field as _
15590 } else {
15591 super::SimpleSignature::default_instance() as _
15592 }
15593 }
15594 pub fn simple_opt(&self) -> Option<&super::SimpleSignature> {
15596 if let Some(super::user_signature::Signature::Simple(field)) = &self
15597 .signature
15598 {
15599 Some(field as _)
15600 } else {
15601 None
15602 }
15603 }
15604 pub fn simple_opt_mut(&mut self) -> Option<&mut super::SimpleSignature> {
15606 if let Some(super::user_signature::Signature::Simple(field)) = &mut self
15607 .signature
15608 {
15609 Some(field as _)
15610 } else {
15611 None
15612 }
15613 }
15614 pub fn simple_mut(&mut self) -> &mut super::SimpleSignature {
15618 if self.simple_opt_mut().is_none() {
15619 self.signature = Some(
15620 super::user_signature::Signature::Simple(
15621 super::SimpleSignature::default(),
15622 ),
15623 );
15624 }
15625 self.simple_opt_mut().unwrap()
15626 }
15627 pub fn set_simple<T: Into<super::SimpleSignature>>(&mut self, field: T) {
15630 self.signature = Some(
15631 super::user_signature::Signature::Simple(field.into().into()),
15632 );
15633 }
15634 pub fn with_simple<T: Into<super::SimpleSignature>>(mut self, field: T) -> Self {
15637 self.set_simple(field.into());
15638 self
15639 }
15640 pub fn multisig(&self) -> &super::MultisigAggregatedSignature {
15642 if let Some(super::user_signature::Signature::Multisig(field)) = &self
15643 .signature
15644 {
15645 field as _
15646 } else {
15647 super::MultisigAggregatedSignature::default_instance() as _
15648 }
15649 }
15650 pub fn multisig_opt(&self) -> Option<&super::MultisigAggregatedSignature> {
15652 if let Some(super::user_signature::Signature::Multisig(field)) = &self
15653 .signature
15654 {
15655 Some(field as _)
15656 } else {
15657 None
15658 }
15659 }
15660 pub fn multisig_opt_mut(
15662 &mut self,
15663 ) -> Option<&mut super::MultisigAggregatedSignature> {
15664 if let Some(super::user_signature::Signature::Multisig(field)) = &mut self
15665 .signature
15666 {
15667 Some(field as _)
15668 } else {
15669 None
15670 }
15671 }
15672 pub fn multisig_mut(&mut self) -> &mut super::MultisigAggregatedSignature {
15676 if self.multisig_opt_mut().is_none() {
15677 self.signature = Some(
15678 super::user_signature::Signature::Multisig(
15679 super::MultisigAggregatedSignature::default(),
15680 ),
15681 );
15682 }
15683 self.multisig_opt_mut().unwrap()
15684 }
15685 pub fn set_multisig<T: Into<super::MultisigAggregatedSignature>>(
15688 &mut self,
15689 field: T,
15690 ) {
15691 self.signature = Some(
15692 super::user_signature::Signature::Multisig(field.into().into()),
15693 );
15694 }
15695 pub fn with_multisig<T: Into<super::MultisigAggregatedSignature>>(
15698 mut self,
15699 field: T,
15700 ) -> Self {
15701 self.set_multisig(field.into());
15702 self
15703 }
15704 pub fn zklogin(&self) -> &super::ZkLoginAuthenticator {
15706 if let Some(super::user_signature::Signature::Zklogin(field)) = &self
15707 .signature
15708 {
15709 field as _
15710 } else {
15711 super::ZkLoginAuthenticator::default_instance() as _
15712 }
15713 }
15714 pub fn zklogin_opt(&self) -> Option<&super::ZkLoginAuthenticator> {
15716 if let Some(super::user_signature::Signature::Zklogin(field)) = &self
15717 .signature
15718 {
15719 Some(field as _)
15720 } else {
15721 None
15722 }
15723 }
15724 pub fn zklogin_opt_mut(&mut self) -> Option<&mut super::ZkLoginAuthenticator> {
15726 if let Some(super::user_signature::Signature::Zklogin(field)) = &mut self
15727 .signature
15728 {
15729 Some(field as _)
15730 } else {
15731 None
15732 }
15733 }
15734 pub fn zklogin_mut(&mut self) -> &mut super::ZkLoginAuthenticator {
15738 if self.zklogin_opt_mut().is_none() {
15739 self.signature = Some(
15740 super::user_signature::Signature::Zklogin(
15741 super::ZkLoginAuthenticator::default(),
15742 ),
15743 );
15744 }
15745 self.zklogin_opt_mut().unwrap()
15746 }
15747 pub fn set_zklogin<T: Into<super::ZkLoginAuthenticator>>(&mut self, field: T) {
15750 self.signature = Some(
15751 super::user_signature::Signature::Zklogin(field.into().into()),
15752 );
15753 }
15754 pub fn with_zklogin<T: Into<super::ZkLoginAuthenticator>>(
15757 mut self,
15758 field: T,
15759 ) -> Self {
15760 self.set_zklogin(field.into());
15761 self
15762 }
15763 pub fn passkey(&self) -> &super::PasskeyAuthenticator {
15765 if let Some(super::user_signature::Signature::Passkey(field)) = &self
15766 .signature
15767 {
15768 field as _
15769 } else {
15770 super::PasskeyAuthenticator::default_instance() as _
15771 }
15772 }
15773 pub fn passkey_opt(&self) -> Option<&super::PasskeyAuthenticator> {
15775 if let Some(super::user_signature::Signature::Passkey(field)) = &self
15776 .signature
15777 {
15778 Some(field as _)
15779 } else {
15780 None
15781 }
15782 }
15783 pub fn passkey_opt_mut(&mut self) -> Option<&mut super::PasskeyAuthenticator> {
15785 if let Some(super::user_signature::Signature::Passkey(field)) = &mut self
15786 .signature
15787 {
15788 Some(field as _)
15789 } else {
15790 None
15791 }
15792 }
15793 pub fn passkey_mut(&mut self) -> &mut super::PasskeyAuthenticator {
15797 if self.passkey_opt_mut().is_none() {
15798 self.signature = Some(
15799 super::user_signature::Signature::Passkey(
15800 super::PasskeyAuthenticator::default(),
15801 ),
15802 );
15803 }
15804 self.passkey_opt_mut().unwrap()
15805 }
15806 pub fn set_passkey<T: Into<super::PasskeyAuthenticator>>(&mut self, field: T) {
15809 self.signature = Some(
15810 super::user_signature::Signature::Passkey(field.into().into()),
15811 );
15812 }
15813 pub fn with_passkey<T: Into<super::PasskeyAuthenticator>>(
15816 mut self,
15817 field: T,
15818 ) -> Self {
15819 self.set_passkey(field.into());
15820 self
15821 }
15822 }
15823 impl super::Validator {
15824 pub const fn const_default() -> Self {
15825 Self {
15826 name: None,
15827 address: None,
15828 description: None,
15829 image_url: None,
15830 project_url: None,
15831 protocol_public_key: None,
15832 proof_of_possession: None,
15833 network_public_key: None,
15834 worker_public_key: None,
15835 network_address: None,
15836 p2p_address: None,
15837 primary_address: None,
15838 worker_address: None,
15839 next_epoch_protocol_public_key: None,
15840 next_epoch_proof_of_possession: None,
15841 next_epoch_network_public_key: None,
15842 next_epoch_worker_public_key: None,
15843 next_epoch_network_address: None,
15844 next_epoch_p2p_address: None,
15845 next_epoch_primary_address: None,
15846 next_epoch_worker_address: None,
15847 metadata_extra_fields: None,
15848 voting_power: None,
15849 operation_cap_id: None,
15850 gas_price: None,
15851 staking_pool: None,
15852 commission_rate: None,
15853 next_epoch_stake: None,
15854 next_epoch_gas_price: None,
15855 next_epoch_commission_rate: None,
15856 extra_fields: None,
15857 }
15858 }
15859 #[doc(hidden)]
15860 pub fn default_instance() -> &'static Self {
15861 static DEFAULT: super::Validator = super::Validator::const_default();
15862 &DEFAULT
15863 }
15864 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
15866 self.name.as_mut().map(|field| field as _)
15867 }
15868 pub fn name_mut(&mut self) -> &mut String {
15871 self.name.get_or_insert_default()
15872 }
15873 pub fn name_opt(&self) -> Option<&str> {
15875 self.name.as_ref().map(|field| field as _)
15876 }
15877 pub fn set_name<T: Into<String>>(&mut self, field: T) {
15879 self.name = Some(field.into().into());
15880 }
15881 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
15883 self.set_name(field.into());
15884 self
15885 }
15886 pub fn address_opt_mut(&mut self) -> Option<&mut String> {
15888 self.address.as_mut().map(|field| field as _)
15889 }
15890 pub fn address_mut(&mut self) -> &mut String {
15893 self.address.get_or_insert_default()
15894 }
15895 pub fn address_opt(&self) -> Option<&str> {
15897 self.address.as_ref().map(|field| field as _)
15898 }
15899 pub fn set_address<T: Into<String>>(&mut self, field: T) {
15901 self.address = Some(field.into().into());
15902 }
15903 pub fn with_address<T: Into<String>>(mut self, field: T) -> Self {
15905 self.set_address(field.into());
15906 self
15907 }
15908 pub fn description_opt_mut(&mut self) -> Option<&mut String> {
15910 self.description.as_mut().map(|field| field as _)
15911 }
15912 pub fn description_mut(&mut self) -> &mut String {
15915 self.description.get_or_insert_default()
15916 }
15917 pub fn description_opt(&self) -> Option<&str> {
15919 self.description.as_ref().map(|field| field as _)
15920 }
15921 pub fn set_description<T: Into<String>>(&mut self, field: T) {
15923 self.description = Some(field.into().into());
15924 }
15925 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
15927 self.set_description(field.into());
15928 self
15929 }
15930 pub fn image_url_opt_mut(&mut self) -> Option<&mut String> {
15932 self.image_url.as_mut().map(|field| field as _)
15933 }
15934 pub fn image_url_mut(&mut self) -> &mut String {
15937 self.image_url.get_or_insert_default()
15938 }
15939 pub fn image_url_opt(&self) -> Option<&str> {
15941 self.image_url.as_ref().map(|field| field as _)
15942 }
15943 pub fn set_image_url<T: Into<String>>(&mut self, field: T) {
15945 self.image_url = Some(field.into().into());
15946 }
15947 pub fn with_image_url<T: Into<String>>(mut self, field: T) -> Self {
15949 self.set_image_url(field.into());
15950 self
15951 }
15952 pub fn project_url_opt_mut(&mut self) -> Option<&mut String> {
15954 self.project_url.as_mut().map(|field| field as _)
15955 }
15956 pub fn project_url_mut(&mut self) -> &mut String {
15959 self.project_url.get_or_insert_default()
15960 }
15961 pub fn project_url_opt(&self) -> Option<&str> {
15963 self.project_url.as_ref().map(|field| field as _)
15964 }
15965 pub fn set_project_url<T: Into<String>>(&mut self, field: T) {
15967 self.project_url = Some(field.into().into());
15968 }
15969 pub fn with_project_url<T: Into<String>>(mut self, field: T) -> Self {
15971 self.set_project_url(field.into());
15972 self
15973 }
15974 pub fn protocol_public_key_opt(&self) -> Option<&[u8]> {
15976 self.protocol_public_key.as_ref().map(|field| field as _)
15977 }
15978 pub fn set_protocol_public_key<T: Into<::prost::bytes::Bytes>>(
15980 &mut self,
15981 field: T,
15982 ) {
15983 self.protocol_public_key = Some(field.into().into());
15984 }
15985 pub fn with_protocol_public_key<T: Into<::prost::bytes::Bytes>>(
15987 mut self,
15988 field: T,
15989 ) -> Self {
15990 self.set_protocol_public_key(field.into());
15991 self
15992 }
15993 pub fn proof_of_possession_opt(&self) -> Option<&[u8]> {
15995 self.proof_of_possession.as_ref().map(|field| field as _)
15996 }
15997 pub fn set_proof_of_possession<T: Into<::prost::bytes::Bytes>>(
15999 &mut self,
16000 field: T,
16001 ) {
16002 self.proof_of_possession = Some(field.into().into());
16003 }
16004 pub fn with_proof_of_possession<T: Into<::prost::bytes::Bytes>>(
16006 mut self,
16007 field: T,
16008 ) -> Self {
16009 self.set_proof_of_possession(field.into());
16010 self
16011 }
16012 pub fn network_public_key_opt(&self) -> Option<&[u8]> {
16014 self.network_public_key.as_ref().map(|field| field as _)
16015 }
16016 pub fn set_network_public_key<T: Into<::prost::bytes::Bytes>>(
16018 &mut self,
16019 field: T,
16020 ) {
16021 self.network_public_key = Some(field.into().into());
16022 }
16023 pub fn with_network_public_key<T: Into<::prost::bytes::Bytes>>(
16025 mut self,
16026 field: T,
16027 ) -> Self {
16028 self.set_network_public_key(field.into());
16029 self
16030 }
16031 pub fn worker_public_key_opt(&self) -> Option<&[u8]> {
16033 self.worker_public_key.as_ref().map(|field| field as _)
16034 }
16035 pub fn set_worker_public_key<T: Into<::prost::bytes::Bytes>>(
16037 &mut self,
16038 field: T,
16039 ) {
16040 self.worker_public_key = Some(field.into().into());
16041 }
16042 pub fn with_worker_public_key<T: Into<::prost::bytes::Bytes>>(
16044 mut self,
16045 field: T,
16046 ) -> Self {
16047 self.set_worker_public_key(field.into());
16048 self
16049 }
16050 pub fn network_address_opt_mut(&mut self) -> Option<&mut String> {
16052 self.network_address.as_mut().map(|field| field as _)
16053 }
16054 pub fn network_address_mut(&mut self) -> &mut String {
16057 self.network_address.get_or_insert_default()
16058 }
16059 pub fn network_address_opt(&self) -> Option<&str> {
16061 self.network_address.as_ref().map(|field| field as _)
16062 }
16063 pub fn set_network_address<T: Into<String>>(&mut self, field: T) {
16065 self.network_address = Some(field.into().into());
16066 }
16067 pub fn with_network_address<T: Into<String>>(mut self, field: T) -> Self {
16069 self.set_network_address(field.into());
16070 self
16071 }
16072 pub fn p2p_address_opt_mut(&mut self) -> Option<&mut String> {
16074 self.p2p_address.as_mut().map(|field| field as _)
16075 }
16076 pub fn p2p_address_mut(&mut self) -> &mut String {
16079 self.p2p_address.get_or_insert_default()
16080 }
16081 pub fn p2p_address_opt(&self) -> Option<&str> {
16083 self.p2p_address.as_ref().map(|field| field as _)
16084 }
16085 pub fn set_p2p_address<T: Into<String>>(&mut self, field: T) {
16087 self.p2p_address = Some(field.into().into());
16088 }
16089 pub fn with_p2p_address<T: Into<String>>(mut self, field: T) -> Self {
16091 self.set_p2p_address(field.into());
16092 self
16093 }
16094 pub fn primary_address_opt_mut(&mut self) -> Option<&mut String> {
16096 self.primary_address.as_mut().map(|field| field as _)
16097 }
16098 pub fn primary_address_mut(&mut self) -> &mut String {
16101 self.primary_address.get_or_insert_default()
16102 }
16103 pub fn primary_address_opt(&self) -> Option<&str> {
16105 self.primary_address.as_ref().map(|field| field as _)
16106 }
16107 pub fn set_primary_address<T: Into<String>>(&mut self, field: T) {
16109 self.primary_address = Some(field.into().into());
16110 }
16111 pub fn with_primary_address<T: Into<String>>(mut self, field: T) -> Self {
16113 self.set_primary_address(field.into());
16114 self
16115 }
16116 pub fn worker_address_opt_mut(&mut self) -> Option<&mut String> {
16118 self.worker_address.as_mut().map(|field| field as _)
16119 }
16120 pub fn worker_address_mut(&mut self) -> &mut String {
16123 self.worker_address.get_or_insert_default()
16124 }
16125 pub fn worker_address_opt(&self) -> Option<&str> {
16127 self.worker_address.as_ref().map(|field| field as _)
16128 }
16129 pub fn set_worker_address<T: Into<String>>(&mut self, field: T) {
16131 self.worker_address = Some(field.into().into());
16132 }
16133 pub fn with_worker_address<T: Into<String>>(mut self, field: T) -> Self {
16135 self.set_worker_address(field.into());
16136 self
16137 }
16138 pub fn next_epoch_protocol_public_key_opt(&self) -> Option<&[u8]> {
16140 self.next_epoch_protocol_public_key.as_ref().map(|field| field as _)
16141 }
16142 pub fn set_next_epoch_protocol_public_key<T: Into<::prost::bytes::Bytes>>(
16144 &mut self,
16145 field: T,
16146 ) {
16147 self.next_epoch_protocol_public_key = Some(field.into().into());
16148 }
16149 pub fn with_next_epoch_protocol_public_key<T: Into<::prost::bytes::Bytes>>(
16151 mut self,
16152 field: T,
16153 ) -> Self {
16154 self.set_next_epoch_protocol_public_key(field.into());
16155 self
16156 }
16157 pub fn next_epoch_proof_of_possession_opt(&self) -> Option<&[u8]> {
16159 self.next_epoch_proof_of_possession.as_ref().map(|field| field as _)
16160 }
16161 pub fn set_next_epoch_proof_of_possession<T: Into<::prost::bytes::Bytes>>(
16163 &mut self,
16164 field: T,
16165 ) {
16166 self.next_epoch_proof_of_possession = Some(field.into().into());
16167 }
16168 pub fn with_next_epoch_proof_of_possession<T: Into<::prost::bytes::Bytes>>(
16170 mut self,
16171 field: T,
16172 ) -> Self {
16173 self.set_next_epoch_proof_of_possession(field.into());
16174 self
16175 }
16176 pub fn next_epoch_network_public_key_opt(&self) -> Option<&[u8]> {
16178 self.next_epoch_network_public_key.as_ref().map(|field| field as _)
16179 }
16180 pub fn set_next_epoch_network_public_key<T: Into<::prost::bytes::Bytes>>(
16182 &mut self,
16183 field: T,
16184 ) {
16185 self.next_epoch_network_public_key = Some(field.into().into());
16186 }
16187 pub fn with_next_epoch_network_public_key<T: Into<::prost::bytes::Bytes>>(
16189 mut self,
16190 field: T,
16191 ) -> Self {
16192 self.set_next_epoch_network_public_key(field.into());
16193 self
16194 }
16195 pub fn next_epoch_worker_public_key_opt(&self) -> Option<&[u8]> {
16197 self.next_epoch_worker_public_key.as_ref().map(|field| field as _)
16198 }
16199 pub fn set_next_epoch_worker_public_key<T: Into<::prost::bytes::Bytes>>(
16201 &mut self,
16202 field: T,
16203 ) {
16204 self.next_epoch_worker_public_key = Some(field.into().into());
16205 }
16206 pub fn with_next_epoch_worker_public_key<T: Into<::prost::bytes::Bytes>>(
16208 mut self,
16209 field: T,
16210 ) -> Self {
16211 self.set_next_epoch_worker_public_key(field.into());
16212 self
16213 }
16214 pub fn next_epoch_network_address_opt_mut(&mut self) -> Option<&mut String> {
16216 self.next_epoch_network_address.as_mut().map(|field| field as _)
16217 }
16218 pub fn next_epoch_network_address_mut(&mut self) -> &mut String {
16221 self.next_epoch_network_address.get_or_insert_default()
16222 }
16223 pub fn next_epoch_network_address_opt(&self) -> Option<&str> {
16225 self.next_epoch_network_address.as_ref().map(|field| field as _)
16226 }
16227 pub fn set_next_epoch_network_address<T: Into<String>>(&mut self, field: T) {
16229 self.next_epoch_network_address = Some(field.into().into());
16230 }
16231 pub fn with_next_epoch_network_address<T: Into<String>>(
16233 mut self,
16234 field: T,
16235 ) -> Self {
16236 self.set_next_epoch_network_address(field.into());
16237 self
16238 }
16239 pub fn next_epoch_p2p_address_opt_mut(&mut self) -> Option<&mut String> {
16241 self.next_epoch_p2p_address.as_mut().map(|field| field as _)
16242 }
16243 pub fn next_epoch_p2p_address_mut(&mut self) -> &mut String {
16246 self.next_epoch_p2p_address.get_or_insert_default()
16247 }
16248 pub fn next_epoch_p2p_address_opt(&self) -> Option<&str> {
16250 self.next_epoch_p2p_address.as_ref().map(|field| field as _)
16251 }
16252 pub fn set_next_epoch_p2p_address<T: Into<String>>(&mut self, field: T) {
16254 self.next_epoch_p2p_address = Some(field.into().into());
16255 }
16256 pub fn with_next_epoch_p2p_address<T: Into<String>>(mut self, field: T) -> Self {
16258 self.set_next_epoch_p2p_address(field.into());
16259 self
16260 }
16261 pub fn next_epoch_primary_address_opt_mut(&mut self) -> Option<&mut String> {
16263 self.next_epoch_primary_address.as_mut().map(|field| field as _)
16264 }
16265 pub fn next_epoch_primary_address_mut(&mut self) -> &mut String {
16268 self.next_epoch_primary_address.get_or_insert_default()
16269 }
16270 pub fn next_epoch_primary_address_opt(&self) -> Option<&str> {
16272 self.next_epoch_primary_address.as_ref().map(|field| field as _)
16273 }
16274 pub fn set_next_epoch_primary_address<T: Into<String>>(&mut self, field: T) {
16276 self.next_epoch_primary_address = Some(field.into().into());
16277 }
16278 pub fn with_next_epoch_primary_address<T: Into<String>>(
16280 mut self,
16281 field: T,
16282 ) -> Self {
16283 self.set_next_epoch_primary_address(field.into());
16284 self
16285 }
16286 pub fn next_epoch_worker_address_opt_mut(&mut self) -> Option<&mut String> {
16288 self.next_epoch_worker_address.as_mut().map(|field| field as _)
16289 }
16290 pub fn next_epoch_worker_address_mut(&mut self) -> &mut String {
16293 self.next_epoch_worker_address.get_or_insert_default()
16294 }
16295 pub fn next_epoch_worker_address_opt(&self) -> Option<&str> {
16297 self.next_epoch_worker_address.as_ref().map(|field| field as _)
16298 }
16299 pub fn set_next_epoch_worker_address<T: Into<String>>(&mut self, field: T) {
16301 self.next_epoch_worker_address = Some(field.into().into());
16302 }
16303 pub fn with_next_epoch_worker_address<T: Into<String>>(
16305 mut self,
16306 field: T,
16307 ) -> Self {
16308 self.set_next_epoch_worker_address(field.into());
16309 self
16310 }
16311 pub fn metadata_extra_fields(&self) -> &super::MoveTable {
16313 self.metadata_extra_fields
16314 .as_ref()
16315 .map(|field| field as _)
16316 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
16317 }
16318 pub fn metadata_extra_fields_opt_mut(
16320 &mut self,
16321 ) -> Option<&mut super::MoveTable> {
16322 self.metadata_extra_fields.as_mut().map(|field| field as _)
16323 }
16324 pub fn metadata_extra_fields_mut(&mut self) -> &mut super::MoveTable {
16327 self.metadata_extra_fields.get_or_insert_default()
16328 }
16329 pub fn metadata_extra_fields_opt(&self) -> Option<&super::MoveTable> {
16331 self.metadata_extra_fields.as_ref().map(|field| field as _)
16332 }
16333 pub fn set_metadata_extra_fields<T: Into<super::MoveTable>>(
16335 &mut self,
16336 field: T,
16337 ) {
16338 self.metadata_extra_fields = Some(field.into().into());
16339 }
16340 pub fn with_metadata_extra_fields<T: Into<super::MoveTable>>(
16342 mut self,
16343 field: T,
16344 ) -> Self {
16345 self.set_metadata_extra_fields(field.into());
16346 self
16347 }
16348 pub fn voting_power_opt_mut(&mut self) -> Option<&mut u64> {
16350 self.voting_power.as_mut().map(|field| field as _)
16351 }
16352 pub fn voting_power_mut(&mut self) -> &mut u64 {
16355 self.voting_power.get_or_insert_default()
16356 }
16357 pub fn voting_power_opt(&self) -> Option<u64> {
16359 self.voting_power.as_ref().map(|field| *field)
16360 }
16361 pub fn set_voting_power<T: Into<u64>>(&mut self, field: T) {
16363 self.voting_power = Some(field.into().into());
16364 }
16365 pub fn with_voting_power<T: Into<u64>>(mut self, field: T) -> Self {
16367 self.set_voting_power(field.into());
16368 self
16369 }
16370 pub fn operation_cap_id_opt_mut(&mut self) -> Option<&mut String> {
16372 self.operation_cap_id.as_mut().map(|field| field as _)
16373 }
16374 pub fn operation_cap_id_mut(&mut self) -> &mut String {
16377 self.operation_cap_id.get_or_insert_default()
16378 }
16379 pub fn operation_cap_id_opt(&self) -> Option<&str> {
16381 self.operation_cap_id.as_ref().map(|field| field as _)
16382 }
16383 pub fn set_operation_cap_id<T: Into<String>>(&mut self, field: T) {
16385 self.operation_cap_id = Some(field.into().into());
16386 }
16387 pub fn with_operation_cap_id<T: Into<String>>(mut self, field: T) -> Self {
16389 self.set_operation_cap_id(field.into());
16390 self
16391 }
16392 pub fn gas_price_opt_mut(&mut self) -> Option<&mut u64> {
16394 self.gas_price.as_mut().map(|field| field as _)
16395 }
16396 pub fn gas_price_mut(&mut self) -> &mut u64 {
16399 self.gas_price.get_or_insert_default()
16400 }
16401 pub fn gas_price_opt(&self) -> Option<u64> {
16403 self.gas_price.as_ref().map(|field| *field)
16404 }
16405 pub fn set_gas_price<T: Into<u64>>(&mut self, field: T) {
16407 self.gas_price = Some(field.into().into());
16408 }
16409 pub fn with_gas_price<T: Into<u64>>(mut self, field: T) -> Self {
16411 self.set_gas_price(field.into());
16412 self
16413 }
16414 pub fn staking_pool(&self) -> &super::StakingPool {
16416 self.staking_pool
16417 .as_ref()
16418 .map(|field| field as _)
16419 .unwrap_or_else(|| super::StakingPool::default_instance() as _)
16420 }
16421 pub fn staking_pool_opt_mut(&mut self) -> Option<&mut super::StakingPool> {
16423 self.staking_pool.as_mut().map(|field| field as _)
16424 }
16425 pub fn staking_pool_mut(&mut self) -> &mut super::StakingPool {
16428 self.staking_pool.get_or_insert_default()
16429 }
16430 pub fn staking_pool_opt(&self) -> Option<&super::StakingPool> {
16432 self.staking_pool.as_ref().map(|field| field as _)
16433 }
16434 pub fn set_staking_pool<T: Into<super::StakingPool>>(&mut self, field: T) {
16436 self.staking_pool = Some(field.into().into());
16437 }
16438 pub fn with_staking_pool<T: Into<super::StakingPool>>(
16440 mut self,
16441 field: T,
16442 ) -> Self {
16443 self.set_staking_pool(field.into());
16444 self
16445 }
16446 pub fn commission_rate_opt_mut(&mut self) -> Option<&mut u64> {
16448 self.commission_rate.as_mut().map(|field| field as _)
16449 }
16450 pub fn commission_rate_mut(&mut self) -> &mut u64 {
16453 self.commission_rate.get_or_insert_default()
16454 }
16455 pub fn commission_rate_opt(&self) -> Option<u64> {
16457 self.commission_rate.as_ref().map(|field| *field)
16458 }
16459 pub fn set_commission_rate<T: Into<u64>>(&mut self, field: T) {
16461 self.commission_rate = Some(field.into().into());
16462 }
16463 pub fn with_commission_rate<T: Into<u64>>(mut self, field: T) -> Self {
16465 self.set_commission_rate(field.into());
16466 self
16467 }
16468 pub fn next_epoch_stake_opt_mut(&mut self) -> Option<&mut u64> {
16470 self.next_epoch_stake.as_mut().map(|field| field as _)
16471 }
16472 pub fn next_epoch_stake_mut(&mut self) -> &mut u64 {
16475 self.next_epoch_stake.get_or_insert_default()
16476 }
16477 pub fn next_epoch_stake_opt(&self) -> Option<u64> {
16479 self.next_epoch_stake.as_ref().map(|field| *field)
16480 }
16481 pub fn set_next_epoch_stake<T: Into<u64>>(&mut self, field: T) {
16483 self.next_epoch_stake = Some(field.into().into());
16484 }
16485 pub fn with_next_epoch_stake<T: Into<u64>>(mut self, field: T) -> Self {
16487 self.set_next_epoch_stake(field.into());
16488 self
16489 }
16490 pub fn next_epoch_gas_price_opt_mut(&mut self) -> Option<&mut u64> {
16492 self.next_epoch_gas_price.as_mut().map(|field| field as _)
16493 }
16494 pub fn next_epoch_gas_price_mut(&mut self) -> &mut u64 {
16497 self.next_epoch_gas_price.get_or_insert_default()
16498 }
16499 pub fn next_epoch_gas_price_opt(&self) -> Option<u64> {
16501 self.next_epoch_gas_price.as_ref().map(|field| *field)
16502 }
16503 pub fn set_next_epoch_gas_price<T: Into<u64>>(&mut self, field: T) {
16505 self.next_epoch_gas_price = Some(field.into().into());
16506 }
16507 pub fn with_next_epoch_gas_price<T: Into<u64>>(mut self, field: T) -> Self {
16509 self.set_next_epoch_gas_price(field.into());
16510 self
16511 }
16512 pub fn next_epoch_commission_rate_opt_mut(&mut self) -> Option<&mut u64> {
16514 self.next_epoch_commission_rate.as_mut().map(|field| field as _)
16515 }
16516 pub fn next_epoch_commission_rate_mut(&mut self) -> &mut u64 {
16519 self.next_epoch_commission_rate.get_or_insert_default()
16520 }
16521 pub fn next_epoch_commission_rate_opt(&self) -> Option<u64> {
16523 self.next_epoch_commission_rate.as_ref().map(|field| *field)
16524 }
16525 pub fn set_next_epoch_commission_rate<T: Into<u64>>(&mut self, field: T) {
16527 self.next_epoch_commission_rate = Some(field.into().into());
16528 }
16529 pub fn with_next_epoch_commission_rate<T: Into<u64>>(
16531 mut self,
16532 field: T,
16533 ) -> Self {
16534 self.set_next_epoch_commission_rate(field.into());
16535 self
16536 }
16537 pub fn extra_fields(&self) -> &super::MoveTable {
16539 self.extra_fields
16540 .as_ref()
16541 .map(|field| field as _)
16542 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
16543 }
16544 pub fn extra_fields_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
16546 self.extra_fields.as_mut().map(|field| field as _)
16547 }
16548 pub fn extra_fields_mut(&mut self) -> &mut super::MoveTable {
16551 self.extra_fields.get_or_insert_default()
16552 }
16553 pub fn extra_fields_opt(&self) -> Option<&super::MoveTable> {
16555 self.extra_fields.as_ref().map(|field| field as _)
16556 }
16557 pub fn set_extra_fields<T: Into<super::MoveTable>>(&mut self, field: T) {
16559 self.extra_fields = Some(field.into().into());
16560 }
16561 pub fn with_extra_fields<T: Into<super::MoveTable>>(mut self, field: T) -> Self {
16563 self.set_extra_fields(field.into());
16564 self
16565 }
16566 }
16567 impl super::ValidatorAggregatedSignature {
16568 pub const fn const_default() -> Self {
16569 Self {
16570 epoch: None,
16571 signature: None,
16572 bitmap: Vec::new(),
16573 }
16574 }
16575 #[doc(hidden)]
16576 pub fn default_instance() -> &'static Self {
16577 static DEFAULT: super::ValidatorAggregatedSignature = super::ValidatorAggregatedSignature::const_default();
16578 &DEFAULT
16579 }
16580 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
16582 self.epoch.as_mut().map(|field| field as _)
16583 }
16584 pub fn epoch_mut(&mut self) -> &mut u64 {
16587 self.epoch.get_or_insert_default()
16588 }
16589 pub fn epoch_opt(&self) -> Option<u64> {
16591 self.epoch.as_ref().map(|field| *field)
16592 }
16593 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
16595 self.epoch = Some(field.into().into());
16596 }
16597 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
16599 self.set_epoch(field.into());
16600 self
16601 }
16602 pub fn signature_opt(&self) -> Option<&[u8]> {
16604 self.signature.as_ref().map(|field| field as _)
16605 }
16606 pub fn set_signature<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
16608 self.signature = Some(field.into().into());
16609 }
16610 pub fn with_signature<T: Into<::prost::bytes::Bytes>>(
16612 mut self,
16613 field: T,
16614 ) -> Self {
16615 self.set_signature(field.into());
16616 self
16617 }
16618 pub fn bitmap(&self) -> &[u32] {
16620 &self.bitmap
16621 }
16622 pub fn bitmap_mut(&mut self) -> &mut Vec<u32> {
16625 &mut self.bitmap
16626 }
16627 pub fn set_bitmap(&mut self, field: Vec<u32>) {
16629 self.bitmap = field;
16630 }
16631 pub fn with_bitmap(mut self, field: Vec<u32>) -> Self {
16633 self.set_bitmap(field);
16634 self
16635 }
16636 }
16637 impl super::ValidatorCommittee {
16638 pub const fn const_default() -> Self {
16639 Self {
16640 epoch: None,
16641 members: Vec::new(),
16642 }
16643 }
16644 #[doc(hidden)]
16645 pub fn default_instance() -> &'static Self {
16646 static DEFAULT: super::ValidatorCommittee = super::ValidatorCommittee::const_default();
16647 &DEFAULT
16648 }
16649 pub fn epoch_opt_mut(&mut self) -> Option<&mut u64> {
16651 self.epoch.as_mut().map(|field| field as _)
16652 }
16653 pub fn epoch_mut(&mut self) -> &mut u64 {
16656 self.epoch.get_or_insert_default()
16657 }
16658 pub fn epoch_opt(&self) -> Option<u64> {
16660 self.epoch.as_ref().map(|field| *field)
16661 }
16662 pub fn set_epoch<T: Into<u64>>(&mut self, field: T) {
16664 self.epoch = Some(field.into().into());
16665 }
16666 pub fn with_epoch<T: Into<u64>>(mut self, field: T) -> Self {
16668 self.set_epoch(field.into());
16669 self
16670 }
16671 pub fn members(&self) -> &[super::ValidatorCommitteeMember] {
16673 &self.members
16674 }
16675 pub fn members_mut(&mut self) -> &mut Vec<super::ValidatorCommitteeMember> {
16678 &mut self.members
16679 }
16680 pub fn set_members(&mut self, field: Vec<super::ValidatorCommitteeMember>) {
16682 self.members = field;
16683 }
16684 pub fn with_members(
16686 mut self,
16687 field: Vec<super::ValidatorCommitteeMember>,
16688 ) -> Self {
16689 self.set_members(field);
16690 self
16691 }
16692 }
16693 impl super::ValidatorCommitteeMember {
16694 pub const fn const_default() -> Self {
16695 Self {
16696 public_key: None,
16697 weight: None,
16698 }
16699 }
16700 #[doc(hidden)]
16701 pub fn default_instance() -> &'static Self {
16702 static DEFAULT: super::ValidatorCommitteeMember = super::ValidatorCommitteeMember::const_default();
16703 &DEFAULT
16704 }
16705 pub fn public_key_opt(&self) -> Option<&[u8]> {
16707 self.public_key.as_ref().map(|field| field as _)
16708 }
16709 pub fn set_public_key<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
16711 self.public_key = Some(field.into().into());
16712 }
16713 pub fn with_public_key<T: Into<::prost::bytes::Bytes>>(
16715 mut self,
16716 field: T,
16717 ) -> Self {
16718 self.set_public_key(field.into());
16719 self
16720 }
16721 pub fn weight_opt_mut(&mut self) -> Option<&mut u64> {
16723 self.weight.as_mut().map(|field| field as _)
16724 }
16725 pub fn weight_mut(&mut self) -> &mut u64 {
16728 self.weight.get_or_insert_default()
16729 }
16730 pub fn weight_opt(&self) -> Option<u64> {
16732 self.weight.as_ref().map(|field| *field)
16733 }
16734 pub fn set_weight<T: Into<u64>>(&mut self, field: T) {
16736 self.weight = Some(field.into().into());
16737 }
16738 pub fn with_weight<T: Into<u64>>(mut self, field: T) -> Self {
16740 self.set_weight(field.into());
16741 self
16742 }
16743 }
16744 impl super::ValidatorExecutionTimeObservation {
16745 pub const fn const_default() -> Self {
16746 Self {
16747 validator: None,
16748 duration: None,
16749 }
16750 }
16751 #[doc(hidden)]
16752 pub fn default_instance() -> &'static Self {
16753 static DEFAULT: super::ValidatorExecutionTimeObservation = super::ValidatorExecutionTimeObservation::const_default();
16754 &DEFAULT
16755 }
16756 pub fn validator_opt(&self) -> Option<&[u8]> {
16758 self.validator.as_ref().map(|field| field as _)
16759 }
16760 pub fn set_validator<T: Into<::prost::bytes::Bytes>>(&mut self, field: T) {
16762 self.validator = Some(field.into().into());
16763 }
16764 pub fn with_validator<T: Into<::prost::bytes::Bytes>>(
16766 mut self,
16767 field: T,
16768 ) -> Self {
16769 self.set_validator(field.into());
16770 self
16771 }
16772 pub fn duration_opt_mut(&mut self) -> Option<&mut ::prost_types::Duration> {
16774 self.duration.as_mut().map(|field| field as _)
16775 }
16776 pub fn duration_mut(&mut self) -> &mut ::prost_types::Duration {
16779 self.duration.get_or_insert_default()
16780 }
16781 pub fn duration_opt(&self) -> Option<&::prost_types::Duration> {
16783 self.duration.as_ref().map(|field| field as _)
16784 }
16785 pub fn set_duration<T: Into<::prost_types::Duration>>(&mut self, field: T) {
16787 self.duration = Some(field.into().into());
16788 }
16789 pub fn with_duration<T: Into<::prost_types::Duration>>(
16791 mut self,
16792 field: T,
16793 ) -> Self {
16794 self.set_duration(field.into());
16795 self
16796 }
16797 }
16798 impl super::ValidatorReportRecord {
16799 pub const fn const_default() -> Self {
16800 Self {
16801 reported: None,
16802 reporters: Vec::new(),
16803 }
16804 }
16805 #[doc(hidden)]
16806 pub fn default_instance() -> &'static Self {
16807 static DEFAULT: super::ValidatorReportRecord = super::ValidatorReportRecord::const_default();
16808 &DEFAULT
16809 }
16810 pub fn reported_opt_mut(&mut self) -> Option<&mut String> {
16812 self.reported.as_mut().map(|field| field as _)
16813 }
16814 pub fn reported_mut(&mut self) -> &mut String {
16817 self.reported.get_or_insert_default()
16818 }
16819 pub fn reported_opt(&self) -> Option<&str> {
16821 self.reported.as_ref().map(|field| field as _)
16822 }
16823 pub fn set_reported<T: Into<String>>(&mut self, field: T) {
16825 self.reported = Some(field.into().into());
16826 }
16827 pub fn with_reported<T: Into<String>>(mut self, field: T) -> Self {
16829 self.set_reported(field.into());
16830 self
16831 }
16832 pub fn reporters(&self) -> &[String] {
16834 &self.reporters
16835 }
16836 pub fn reporters_mut(&mut self) -> &mut Vec<String> {
16839 &mut self.reporters
16840 }
16841 pub fn set_reporters(&mut self, field: Vec<String>) {
16843 self.reporters = field;
16844 }
16845 pub fn with_reporters(mut self, field: Vec<String>) -> Self {
16847 self.set_reporters(field);
16848 self
16849 }
16850 }
16851 impl super::ValidatorSet {
16852 pub const fn const_default() -> Self {
16853 Self {
16854 total_stake: None,
16855 active_validators: Vec::new(),
16856 pending_active_validators: None,
16857 pending_removals: Vec::new(),
16858 staking_pool_mappings: None,
16859 inactive_validators: None,
16860 validator_candidates: None,
16861 at_risk_validators: std::collections::BTreeMap::new(),
16862 extra_fields: None,
16863 }
16864 }
16865 #[doc(hidden)]
16866 pub fn default_instance() -> &'static Self {
16867 static DEFAULT: super::ValidatorSet = super::ValidatorSet::const_default();
16868 &DEFAULT
16869 }
16870 pub fn total_stake_opt_mut(&mut self) -> Option<&mut u64> {
16872 self.total_stake.as_mut().map(|field| field as _)
16873 }
16874 pub fn total_stake_mut(&mut self) -> &mut u64 {
16877 self.total_stake.get_or_insert_default()
16878 }
16879 pub fn total_stake_opt(&self) -> Option<u64> {
16881 self.total_stake.as_ref().map(|field| *field)
16882 }
16883 pub fn set_total_stake<T: Into<u64>>(&mut self, field: T) {
16885 self.total_stake = Some(field.into().into());
16886 }
16887 pub fn with_total_stake<T: Into<u64>>(mut self, field: T) -> Self {
16889 self.set_total_stake(field.into());
16890 self
16891 }
16892 pub fn active_validators(&self) -> &[super::Validator] {
16894 &self.active_validators
16895 }
16896 pub fn active_validators_mut(&mut self) -> &mut Vec<super::Validator> {
16899 &mut self.active_validators
16900 }
16901 pub fn set_active_validators(&mut self, field: Vec<super::Validator>) {
16903 self.active_validators = field;
16904 }
16905 pub fn with_active_validators(mut self, field: Vec<super::Validator>) -> Self {
16907 self.set_active_validators(field);
16908 self
16909 }
16910 pub fn pending_active_validators(&self) -> &super::MoveTable {
16912 self.pending_active_validators
16913 .as_ref()
16914 .map(|field| field as _)
16915 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
16916 }
16917 pub fn pending_active_validators_opt_mut(
16919 &mut self,
16920 ) -> Option<&mut super::MoveTable> {
16921 self.pending_active_validators.as_mut().map(|field| field as _)
16922 }
16923 pub fn pending_active_validators_mut(&mut self) -> &mut super::MoveTable {
16926 self.pending_active_validators.get_or_insert_default()
16927 }
16928 pub fn pending_active_validators_opt(&self) -> Option<&super::MoveTable> {
16930 self.pending_active_validators.as_ref().map(|field| field as _)
16931 }
16932 pub fn set_pending_active_validators<T: Into<super::MoveTable>>(
16934 &mut self,
16935 field: T,
16936 ) {
16937 self.pending_active_validators = Some(field.into().into());
16938 }
16939 pub fn with_pending_active_validators<T: Into<super::MoveTable>>(
16941 mut self,
16942 field: T,
16943 ) -> Self {
16944 self.set_pending_active_validators(field.into());
16945 self
16946 }
16947 pub fn pending_removals(&self) -> &[u64] {
16949 &self.pending_removals
16950 }
16951 pub fn pending_removals_mut(&mut self) -> &mut Vec<u64> {
16954 &mut self.pending_removals
16955 }
16956 pub fn set_pending_removals(&mut self, field: Vec<u64>) {
16958 self.pending_removals = field;
16959 }
16960 pub fn with_pending_removals(mut self, field: Vec<u64>) -> Self {
16962 self.set_pending_removals(field);
16963 self
16964 }
16965 pub fn staking_pool_mappings(&self) -> &super::MoveTable {
16967 self.staking_pool_mappings
16968 .as_ref()
16969 .map(|field| field as _)
16970 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
16971 }
16972 pub fn staking_pool_mappings_opt_mut(
16974 &mut self,
16975 ) -> Option<&mut super::MoveTable> {
16976 self.staking_pool_mappings.as_mut().map(|field| field as _)
16977 }
16978 pub fn staking_pool_mappings_mut(&mut self) -> &mut super::MoveTable {
16981 self.staking_pool_mappings.get_or_insert_default()
16982 }
16983 pub fn staking_pool_mappings_opt(&self) -> Option<&super::MoveTable> {
16985 self.staking_pool_mappings.as_ref().map(|field| field as _)
16986 }
16987 pub fn set_staking_pool_mappings<T: Into<super::MoveTable>>(
16989 &mut self,
16990 field: T,
16991 ) {
16992 self.staking_pool_mappings = Some(field.into().into());
16993 }
16994 pub fn with_staking_pool_mappings<T: Into<super::MoveTable>>(
16996 mut self,
16997 field: T,
16998 ) -> Self {
16999 self.set_staking_pool_mappings(field.into());
17000 self
17001 }
17002 pub fn inactive_validators(&self) -> &super::MoveTable {
17004 self.inactive_validators
17005 .as_ref()
17006 .map(|field| field as _)
17007 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
17008 }
17009 pub fn inactive_validators_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
17011 self.inactive_validators.as_mut().map(|field| field as _)
17012 }
17013 pub fn inactive_validators_mut(&mut self) -> &mut super::MoveTable {
17016 self.inactive_validators.get_or_insert_default()
17017 }
17018 pub fn inactive_validators_opt(&self) -> Option<&super::MoveTable> {
17020 self.inactive_validators.as_ref().map(|field| field as _)
17021 }
17022 pub fn set_inactive_validators<T: Into<super::MoveTable>>(&mut self, field: T) {
17024 self.inactive_validators = Some(field.into().into());
17025 }
17026 pub fn with_inactive_validators<T: Into<super::MoveTable>>(
17028 mut self,
17029 field: T,
17030 ) -> Self {
17031 self.set_inactive_validators(field.into());
17032 self
17033 }
17034 pub fn validator_candidates(&self) -> &super::MoveTable {
17036 self.validator_candidates
17037 .as_ref()
17038 .map(|field| field as _)
17039 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
17040 }
17041 pub fn validator_candidates_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
17043 self.validator_candidates.as_mut().map(|field| field as _)
17044 }
17045 pub fn validator_candidates_mut(&mut self) -> &mut super::MoveTable {
17048 self.validator_candidates.get_or_insert_default()
17049 }
17050 pub fn validator_candidates_opt(&self) -> Option<&super::MoveTable> {
17052 self.validator_candidates.as_ref().map(|field| field as _)
17053 }
17054 pub fn set_validator_candidates<T: Into<super::MoveTable>>(&mut self, field: T) {
17056 self.validator_candidates = Some(field.into().into());
17057 }
17058 pub fn with_validator_candidates<T: Into<super::MoveTable>>(
17060 mut self,
17061 field: T,
17062 ) -> Self {
17063 self.set_validator_candidates(field.into());
17064 self
17065 }
17066 pub fn at_risk_validators(&self) -> &::std::collections::BTreeMap<String, u64> {
17068 &self.at_risk_validators
17069 }
17070 pub fn at_risk_validators_mut(
17073 &mut self,
17074 ) -> &mut ::std::collections::BTreeMap<String, u64> {
17075 &mut self.at_risk_validators
17076 }
17077 pub fn set_at_risk_validators(
17079 &mut self,
17080 field: ::std::collections::BTreeMap<String, u64>,
17081 ) {
17082 self.at_risk_validators = field;
17083 }
17084 pub fn with_at_risk_validators(
17086 mut self,
17087 field: ::std::collections::BTreeMap<String, u64>,
17088 ) -> Self {
17089 self.set_at_risk_validators(field);
17090 self
17091 }
17092 pub fn extra_fields(&self) -> &super::MoveTable {
17094 self.extra_fields
17095 .as_ref()
17096 .map(|field| field as _)
17097 .unwrap_or_else(|| super::MoveTable::default_instance() as _)
17098 }
17099 pub fn extra_fields_opt_mut(&mut self) -> Option<&mut super::MoveTable> {
17101 self.extra_fields.as_mut().map(|field| field as _)
17102 }
17103 pub fn extra_fields_mut(&mut self) -> &mut super::MoveTable {
17106 self.extra_fields.get_or_insert_default()
17107 }
17108 pub fn extra_fields_opt(&self) -> Option<&super::MoveTable> {
17110 self.extra_fields.as_ref().map(|field| field as _)
17111 }
17112 pub fn set_extra_fields<T: Into<super::MoveTable>>(&mut self, field: T) {
17114 self.extra_fields = Some(field.into().into());
17115 }
17116 pub fn with_extra_fields<T: Into<super::MoveTable>>(mut self, field: T) -> Self {
17118 self.set_extra_fields(field.into());
17119 self
17120 }
17121 }
17122 impl super::VariantDescriptor {
17123 pub const fn const_default() -> Self {
17124 Self {
17125 name: None,
17126 position: None,
17127 fields: Vec::new(),
17128 }
17129 }
17130 #[doc(hidden)]
17131 pub fn default_instance() -> &'static Self {
17132 static DEFAULT: super::VariantDescriptor = super::VariantDescriptor::const_default();
17133 &DEFAULT
17134 }
17135 pub fn name_opt_mut(&mut self) -> Option<&mut String> {
17137 self.name.as_mut().map(|field| field as _)
17138 }
17139 pub fn name_mut(&mut self) -> &mut String {
17142 self.name.get_or_insert_default()
17143 }
17144 pub fn name_opt(&self) -> Option<&str> {
17146 self.name.as_ref().map(|field| field as _)
17147 }
17148 pub fn set_name<T: Into<String>>(&mut self, field: T) {
17150 self.name = Some(field.into().into());
17151 }
17152 pub fn with_name<T: Into<String>>(mut self, field: T) -> Self {
17154 self.set_name(field.into());
17155 self
17156 }
17157 pub fn position_opt_mut(&mut self) -> Option<&mut u32> {
17159 self.position.as_mut().map(|field| field as _)
17160 }
17161 pub fn position_mut(&mut self) -> &mut u32 {
17164 self.position.get_or_insert_default()
17165 }
17166 pub fn position_opt(&self) -> Option<u32> {
17168 self.position.as_ref().map(|field| *field)
17169 }
17170 pub fn set_position<T: Into<u32>>(&mut self, field: T) {
17172 self.position = Some(field.into().into());
17173 }
17174 pub fn with_position<T: Into<u32>>(mut self, field: T) -> Self {
17176 self.set_position(field.into());
17177 self
17178 }
17179 pub fn fields(&self) -> &[super::FieldDescriptor] {
17181 &self.fields
17182 }
17183 pub fn fields_mut(&mut self) -> &mut Vec<super::FieldDescriptor> {
17186 &mut self.fields
17187 }
17188 pub fn set_fields(&mut self, field: Vec<super::FieldDescriptor>) {
17190 self.fields = field;
17191 }
17192 pub fn with_fields(mut self, field: Vec<super::FieldDescriptor>) -> Self {
17194 self.set_fields(field);
17195 self
17196 }
17197 }
17198 impl super::VerifySignatureRequest {
17199 pub const fn const_default() -> Self {
17200 Self {
17201 message: None,
17202 signature: None,
17203 address: None,
17204 jwks: Vec::new(),
17205 }
17206 }
17207 #[doc(hidden)]
17208 pub fn default_instance() -> &'static Self {
17209 static DEFAULT: super::VerifySignatureRequest = super::VerifySignatureRequest::const_default();
17210 &DEFAULT
17211 }
17212 pub fn message(&self) -> &super::Bcs {
17214 self.message
17215 .as_ref()
17216 .map(|field| field as _)
17217 .unwrap_or_else(|| super::Bcs::default_instance() as _)
17218 }
17219 pub fn message_opt_mut(&mut self) -> Option<&mut super::Bcs> {
17221 self.message.as_mut().map(|field| field as _)
17222 }
17223 pub fn message_mut(&mut self) -> &mut super::Bcs {
17226 self.message.get_or_insert_default()
17227 }
17228 pub fn message_opt(&self) -> Option<&super::Bcs> {
17230 self.message.as_ref().map(|field| field as _)
17231 }
17232 pub fn set_message<T: Into<super::Bcs>>(&mut self, field: T) {
17234 self.message = Some(field.into().into());
17235 }
17236 pub fn with_message<T: Into<super::Bcs>>(mut self, field: T) -> Self {
17238 self.set_message(field.into());
17239 self
17240 }
17241 pub fn signature(&self) -> &super::UserSignature {
17243 self.signature
17244 .as_ref()
17245 .map(|field| field as _)
17246 .unwrap_or_else(|| super::UserSignature::default_instance() as _)
17247 }
17248 pub fn signature_opt_mut(&mut self) -> Option<&mut super::UserSignature> {
17250 self.signature.as_mut().map(|field| field as _)
17251 }
17252 pub fn signature_mut(&mut self) -> &mut super::UserSignature {
17255 self.signature.get_or_insert_default()
17256 }
17257 pub fn signature_opt(&self) -> Option<&super::UserSignature> {
17259 self.signature.as_ref().map(|field| field as _)
17260 }
17261 pub fn set_signature<T: Into<super::UserSignature>>(&mut self, field: T) {
17263 self.signature = Some(field.into().into());
17264 }
17265 pub fn with_signature<T: Into<super::UserSignature>>(
17267 mut self,
17268 field: T,
17269 ) -> Self {
17270 self.set_signature(field.into());
17271 self
17272 }
17273 pub fn address_opt_mut(&mut self) -> Option<&mut String> {
17275 self.address.as_mut().map(|field| field as _)
17276 }
17277 pub fn address_mut(&mut self) -> &mut String {
17280 self.address.get_or_insert_default()
17281 }
17282 pub fn address_opt(&self) -> Option<&str> {
17284 self.address.as_ref().map(|field| field as _)
17285 }
17286 pub fn set_address<T: Into<String>>(&mut self, field: T) {
17288 self.address = Some(field.into().into());
17289 }
17290 pub fn with_address<T: Into<String>>(mut self, field: T) -> Self {
17292 self.set_address(field.into());
17293 self
17294 }
17295 pub fn jwks(&self) -> &[super::ActiveJwk] {
17297 &self.jwks
17298 }
17299 pub fn jwks_mut(&mut self) -> &mut Vec<super::ActiveJwk> {
17302 &mut self.jwks
17303 }
17304 pub fn set_jwks(&mut self, field: Vec<super::ActiveJwk>) {
17306 self.jwks = field;
17307 }
17308 pub fn with_jwks(mut self, field: Vec<super::ActiveJwk>) -> Self {
17310 self.set_jwks(field);
17311 self
17312 }
17313 }
17314 impl super::VerifySignatureResponse {
17315 pub const fn const_default() -> Self {
17316 Self {
17317 is_valid: None,
17318 reason: None,
17319 }
17320 }
17321 #[doc(hidden)]
17322 pub fn default_instance() -> &'static Self {
17323 static DEFAULT: super::VerifySignatureResponse = super::VerifySignatureResponse::const_default();
17324 &DEFAULT
17325 }
17326 pub fn is_valid_opt_mut(&mut self) -> Option<&mut bool> {
17328 self.is_valid.as_mut().map(|field| field as _)
17329 }
17330 pub fn is_valid_mut(&mut self) -> &mut bool {
17333 self.is_valid.get_or_insert_default()
17334 }
17335 pub fn is_valid_opt(&self) -> Option<bool> {
17337 self.is_valid.as_ref().map(|field| *field)
17338 }
17339 pub fn set_is_valid<T: Into<bool>>(&mut self, field: T) {
17341 self.is_valid = Some(field.into().into());
17342 }
17343 pub fn with_is_valid<T: Into<bool>>(mut self, field: T) -> Self {
17345 self.set_is_valid(field.into());
17346 self
17347 }
17348 pub fn reason_opt_mut(&mut self) -> Option<&mut String> {
17350 self.reason.as_mut().map(|field| field as _)
17351 }
17352 pub fn reason_mut(&mut self) -> &mut String {
17355 self.reason.get_or_insert_default()
17356 }
17357 pub fn reason_opt(&self) -> Option<&str> {
17359 self.reason.as_ref().map(|field| field as _)
17360 }
17361 pub fn set_reason<T: Into<String>>(&mut self, field: T) {
17363 self.reason = Some(field.into().into());
17364 }
17365 pub fn with_reason<T: Into<String>>(mut self, field: T) -> Self {
17367 self.set_reason(field.into());
17368 self
17369 }
17370 }
17371 impl super::VersionAssignment {
17372 pub const fn const_default() -> Self {
17373 Self {
17374 object_id: None,
17375 start_version: None,
17376 version: None,
17377 }
17378 }
17379 #[doc(hidden)]
17380 pub fn default_instance() -> &'static Self {
17381 static DEFAULT: super::VersionAssignment = super::VersionAssignment::const_default();
17382 &DEFAULT
17383 }
17384 pub fn object_id_opt_mut(&mut self) -> Option<&mut String> {
17386 self.object_id.as_mut().map(|field| field as _)
17387 }
17388 pub fn object_id_mut(&mut self) -> &mut String {
17391 self.object_id.get_or_insert_default()
17392 }
17393 pub fn object_id_opt(&self) -> Option<&str> {
17395 self.object_id.as_ref().map(|field| field as _)
17396 }
17397 pub fn set_object_id<T: Into<String>>(&mut self, field: T) {
17399 self.object_id = Some(field.into().into());
17400 }
17401 pub fn with_object_id<T: Into<String>>(mut self, field: T) -> Self {
17403 self.set_object_id(field.into());
17404 self
17405 }
17406 pub fn start_version_opt_mut(&mut self) -> Option<&mut u64> {
17408 self.start_version.as_mut().map(|field| field as _)
17409 }
17410 pub fn start_version_mut(&mut self) -> &mut u64 {
17413 self.start_version.get_or_insert_default()
17414 }
17415 pub fn start_version_opt(&self) -> Option<u64> {
17417 self.start_version.as_ref().map(|field| *field)
17418 }
17419 pub fn set_start_version<T: Into<u64>>(&mut self, field: T) {
17421 self.start_version = Some(field.into().into());
17422 }
17423 pub fn with_start_version<T: Into<u64>>(mut self, field: T) -> Self {
17425 self.set_start_version(field.into());
17426 self
17427 }
17428 pub fn version_opt_mut(&mut self) -> Option<&mut u64> {
17430 self.version.as_mut().map(|field| field as _)
17431 }
17432 pub fn version_mut(&mut self) -> &mut u64 {
17435 self.version.get_or_insert_default()
17436 }
17437 pub fn version_opt(&self) -> Option<u64> {
17439 self.version.as_ref().map(|field| *field)
17440 }
17441 pub fn set_version<T: Into<u64>>(&mut self, field: T) {
17443 self.version = Some(field.into().into());
17444 }
17445 pub fn with_version<T: Into<u64>>(mut self, field: T) -> Self {
17447 self.set_version(field.into());
17448 self
17449 }
17450 }
17451 impl super::ZkLoginAuthenticator {
17452 pub const fn const_default() -> Self {
17453 Self {
17454 inputs: None,
17455 max_epoch: None,
17456 signature: None,
17457 }
17458 }
17459 #[doc(hidden)]
17460 pub fn default_instance() -> &'static Self {
17461 static DEFAULT: super::ZkLoginAuthenticator = super::ZkLoginAuthenticator::const_default();
17462 &DEFAULT
17463 }
17464 pub fn inputs(&self) -> &super::ZkLoginInputs {
17466 self.inputs
17467 .as_ref()
17468 .map(|field| field as _)
17469 .unwrap_or_else(|| super::ZkLoginInputs::default_instance() as _)
17470 }
17471 pub fn inputs_opt_mut(&mut self) -> Option<&mut super::ZkLoginInputs> {
17473 self.inputs.as_mut().map(|field| field as _)
17474 }
17475 pub fn inputs_mut(&mut self) -> &mut super::ZkLoginInputs {
17478 self.inputs.get_or_insert_default()
17479 }
17480 pub fn inputs_opt(&self) -> Option<&super::ZkLoginInputs> {
17482 self.inputs.as_ref().map(|field| field as _)
17483 }
17484 pub fn set_inputs<T: Into<super::ZkLoginInputs>>(&mut self, field: T) {
17486 self.inputs = Some(field.into().into());
17487 }
17488 pub fn with_inputs<T: Into<super::ZkLoginInputs>>(mut self, field: T) -> Self {
17490 self.set_inputs(field.into());
17491 self
17492 }
17493 pub fn max_epoch_opt_mut(&mut self) -> Option<&mut u64> {
17495 self.max_epoch.as_mut().map(|field| field as _)
17496 }
17497 pub fn max_epoch_mut(&mut self) -> &mut u64 {
17500 self.max_epoch.get_or_insert_default()
17501 }
17502 pub fn max_epoch_opt(&self) -> Option<u64> {
17504 self.max_epoch.as_ref().map(|field| *field)
17505 }
17506 pub fn set_max_epoch<T: Into<u64>>(&mut self, field: T) {
17508 self.max_epoch = Some(field.into().into());
17509 }
17510 pub fn with_max_epoch<T: Into<u64>>(mut self, field: T) -> Self {
17512 self.set_max_epoch(field.into());
17513 self
17514 }
17515 pub fn signature(&self) -> &super::SimpleSignature {
17517 self.signature
17518 .as_ref()
17519 .map(|field| field as _)
17520 .unwrap_or_else(|| super::SimpleSignature::default_instance() as _)
17521 }
17522 pub fn signature_opt_mut(&mut self) -> Option<&mut super::SimpleSignature> {
17524 self.signature.as_mut().map(|field| field as _)
17525 }
17526 pub fn signature_mut(&mut self) -> &mut super::SimpleSignature {
17529 self.signature.get_or_insert_default()
17530 }
17531 pub fn signature_opt(&self) -> Option<&super::SimpleSignature> {
17533 self.signature.as_ref().map(|field| field as _)
17534 }
17535 pub fn set_signature<T: Into<super::SimpleSignature>>(&mut self, field: T) {
17537 self.signature = Some(field.into().into());
17538 }
17539 pub fn with_signature<T: Into<super::SimpleSignature>>(
17541 mut self,
17542 field: T,
17543 ) -> Self {
17544 self.set_signature(field.into());
17545 self
17546 }
17547 }
17548 impl super::ZkLoginClaim {
17549 pub const fn const_default() -> Self {
17550 Self {
17551 value: None,
17552 index_mod_4: None,
17553 }
17554 }
17555 #[doc(hidden)]
17556 pub fn default_instance() -> &'static Self {
17557 static DEFAULT: super::ZkLoginClaim = super::ZkLoginClaim::const_default();
17558 &DEFAULT
17559 }
17560 pub fn value_opt_mut(&mut self) -> Option<&mut String> {
17562 self.value.as_mut().map(|field| field as _)
17563 }
17564 pub fn value_mut(&mut self) -> &mut String {
17567 self.value.get_or_insert_default()
17568 }
17569 pub fn value_opt(&self) -> Option<&str> {
17571 self.value.as_ref().map(|field| field as _)
17572 }
17573 pub fn set_value<T: Into<String>>(&mut self, field: T) {
17575 self.value = Some(field.into().into());
17576 }
17577 pub fn with_value<T: Into<String>>(mut self, field: T) -> Self {
17579 self.set_value(field.into());
17580 self
17581 }
17582 pub fn index_mod_4_opt_mut(&mut self) -> Option<&mut u32> {
17584 self.index_mod_4.as_mut().map(|field| field as _)
17585 }
17586 pub fn index_mod_4_mut(&mut self) -> &mut u32 {
17589 self.index_mod_4.get_or_insert_default()
17590 }
17591 pub fn index_mod_4_opt(&self) -> Option<u32> {
17593 self.index_mod_4.as_ref().map(|field| *field)
17594 }
17595 pub fn set_index_mod_4<T: Into<u32>>(&mut self, field: T) {
17597 self.index_mod_4 = Some(field.into().into());
17598 }
17599 pub fn with_index_mod_4<T: Into<u32>>(mut self, field: T) -> Self {
17601 self.set_index_mod_4(field.into());
17602 self
17603 }
17604 }
17605 impl super::ZkLoginInputs {
17606 pub const fn const_default() -> Self {
17607 Self {
17608 proof_points: None,
17609 iss_base64_details: None,
17610 header_base64: None,
17611 address_seed: None,
17612 }
17613 }
17614 #[doc(hidden)]
17615 pub fn default_instance() -> &'static Self {
17616 static DEFAULT: super::ZkLoginInputs = super::ZkLoginInputs::const_default();
17617 &DEFAULT
17618 }
17619 pub fn proof_points(&self) -> &super::ZkLoginProof {
17621 self.proof_points
17622 .as_ref()
17623 .map(|field| field as _)
17624 .unwrap_or_else(|| super::ZkLoginProof::default_instance() as _)
17625 }
17626 pub fn proof_points_opt_mut(&mut self) -> Option<&mut super::ZkLoginProof> {
17628 self.proof_points.as_mut().map(|field| field as _)
17629 }
17630 pub fn proof_points_mut(&mut self) -> &mut super::ZkLoginProof {
17633 self.proof_points.get_or_insert_default()
17634 }
17635 pub fn proof_points_opt(&self) -> Option<&super::ZkLoginProof> {
17637 self.proof_points.as_ref().map(|field| field as _)
17638 }
17639 pub fn set_proof_points<T: Into<super::ZkLoginProof>>(&mut self, field: T) {
17641 self.proof_points = Some(field.into().into());
17642 }
17643 pub fn with_proof_points<T: Into<super::ZkLoginProof>>(
17645 mut self,
17646 field: T,
17647 ) -> Self {
17648 self.set_proof_points(field.into());
17649 self
17650 }
17651 pub fn iss_base64_details(&self) -> &super::ZkLoginClaim {
17653 self.iss_base64_details
17654 .as_ref()
17655 .map(|field| field as _)
17656 .unwrap_or_else(|| super::ZkLoginClaim::default_instance() as _)
17657 }
17658 pub fn iss_base64_details_opt_mut(
17660 &mut self,
17661 ) -> Option<&mut super::ZkLoginClaim> {
17662 self.iss_base64_details.as_mut().map(|field| field as _)
17663 }
17664 pub fn iss_base64_details_mut(&mut self) -> &mut super::ZkLoginClaim {
17667 self.iss_base64_details.get_or_insert_default()
17668 }
17669 pub fn iss_base64_details_opt(&self) -> Option<&super::ZkLoginClaim> {
17671 self.iss_base64_details.as_ref().map(|field| field as _)
17672 }
17673 pub fn set_iss_base64_details<T: Into<super::ZkLoginClaim>>(
17675 &mut self,
17676 field: T,
17677 ) {
17678 self.iss_base64_details = Some(field.into().into());
17679 }
17680 pub fn with_iss_base64_details<T: Into<super::ZkLoginClaim>>(
17682 mut self,
17683 field: T,
17684 ) -> Self {
17685 self.set_iss_base64_details(field.into());
17686 self
17687 }
17688 pub fn header_base64_opt_mut(&mut self) -> Option<&mut String> {
17690 self.header_base64.as_mut().map(|field| field as _)
17691 }
17692 pub fn header_base64_mut(&mut self) -> &mut String {
17695 self.header_base64.get_or_insert_default()
17696 }
17697 pub fn header_base64_opt(&self) -> Option<&str> {
17699 self.header_base64.as_ref().map(|field| field as _)
17700 }
17701 pub fn set_header_base64<T: Into<String>>(&mut self, field: T) {
17703 self.header_base64 = Some(field.into().into());
17704 }
17705 pub fn with_header_base64<T: Into<String>>(mut self, field: T) -> Self {
17707 self.set_header_base64(field.into());
17708 self
17709 }
17710 pub fn address_seed_opt_mut(&mut self) -> Option<&mut String> {
17712 self.address_seed.as_mut().map(|field| field as _)
17713 }
17714 pub fn address_seed_mut(&mut self) -> &mut String {
17717 self.address_seed.get_or_insert_default()
17718 }
17719 pub fn address_seed_opt(&self) -> Option<&str> {
17721 self.address_seed.as_ref().map(|field| field as _)
17722 }
17723 pub fn set_address_seed<T: Into<String>>(&mut self, field: T) {
17725 self.address_seed = Some(field.into().into());
17726 }
17727 pub fn with_address_seed<T: Into<String>>(mut self, field: T) -> Self {
17729 self.set_address_seed(field.into());
17730 self
17731 }
17732 }
17733 impl super::ZkLoginProof {
17734 pub const fn const_default() -> Self {
17735 Self { a: None, b: None, c: None }
17736 }
17737 #[doc(hidden)]
17738 pub fn default_instance() -> &'static Self {
17739 static DEFAULT: super::ZkLoginProof = super::ZkLoginProof::const_default();
17740 &DEFAULT
17741 }
17742 pub fn a(&self) -> &super::CircomG1 {
17744 self.a
17745 .as_ref()
17746 .map(|field| field as _)
17747 .unwrap_or_else(|| super::CircomG1::default_instance() as _)
17748 }
17749 pub fn a_opt_mut(&mut self) -> Option<&mut super::CircomG1> {
17751 self.a.as_mut().map(|field| field as _)
17752 }
17753 pub fn a_mut(&mut self) -> &mut super::CircomG1 {
17756 self.a.get_or_insert_default()
17757 }
17758 pub fn a_opt(&self) -> Option<&super::CircomG1> {
17760 self.a.as_ref().map(|field| field as _)
17761 }
17762 pub fn set_a<T: Into<super::CircomG1>>(&mut self, field: T) {
17764 self.a = Some(field.into().into());
17765 }
17766 pub fn with_a<T: Into<super::CircomG1>>(mut self, field: T) -> Self {
17768 self.set_a(field.into());
17769 self
17770 }
17771 pub fn b(&self) -> &super::CircomG2 {
17773 self.b
17774 .as_ref()
17775 .map(|field| field as _)
17776 .unwrap_or_else(|| super::CircomG2::default_instance() as _)
17777 }
17778 pub fn b_opt_mut(&mut self) -> Option<&mut super::CircomG2> {
17780 self.b.as_mut().map(|field| field as _)
17781 }
17782 pub fn b_mut(&mut self) -> &mut super::CircomG2 {
17785 self.b.get_or_insert_default()
17786 }
17787 pub fn b_opt(&self) -> Option<&super::CircomG2> {
17789 self.b.as_ref().map(|field| field as _)
17790 }
17791 pub fn set_b<T: Into<super::CircomG2>>(&mut self, field: T) {
17793 self.b = Some(field.into().into());
17794 }
17795 pub fn with_b<T: Into<super::CircomG2>>(mut self, field: T) -> Self {
17797 self.set_b(field.into());
17798 self
17799 }
17800 pub fn c(&self) -> &super::CircomG1 {
17802 self.c
17803 .as_ref()
17804 .map(|field| field as _)
17805 .unwrap_or_else(|| super::CircomG1::default_instance() as _)
17806 }
17807 pub fn c_opt_mut(&mut self) -> Option<&mut super::CircomG1> {
17809 self.c.as_mut().map(|field| field as _)
17810 }
17811 pub fn c_mut(&mut self) -> &mut super::CircomG1 {
17814 self.c.get_or_insert_default()
17815 }
17816 pub fn c_opt(&self) -> Option<&super::CircomG1> {
17818 self.c.as_ref().map(|field| field as _)
17819 }
17820 pub fn set_c<T: Into<super::CircomG1>>(&mut self, field: T) {
17822 self.c = Some(field.into().into());
17823 }
17824 pub fn with_c<T: Into<super::CircomG1>>(mut self, field: T) -> Self {
17826 self.set_c(field.into());
17827 self
17828 }
17829 }
17830 impl super::ZkLoginPublicIdentifier {
17831 pub const fn const_default() -> Self {
17832 Self {
17833 iss: None,
17834 address_seed: None,
17835 }
17836 }
17837 #[doc(hidden)]
17838 pub fn default_instance() -> &'static Self {
17839 static DEFAULT: super::ZkLoginPublicIdentifier = super::ZkLoginPublicIdentifier::const_default();
17840 &DEFAULT
17841 }
17842 pub fn iss_opt_mut(&mut self) -> Option<&mut String> {
17844 self.iss.as_mut().map(|field| field as _)
17845 }
17846 pub fn iss_mut(&mut self) -> &mut String {
17849 self.iss.get_or_insert_default()
17850 }
17851 pub fn iss_opt(&self) -> Option<&str> {
17853 self.iss.as_ref().map(|field| field as _)
17854 }
17855 pub fn set_iss<T: Into<String>>(&mut self, field: T) {
17857 self.iss = Some(field.into().into());
17858 }
17859 pub fn with_iss<T: Into<String>>(mut self, field: T) -> Self {
17861 self.set_iss(field.into());
17862 self
17863 }
17864 pub fn address_seed_opt_mut(&mut self) -> Option<&mut String> {
17866 self.address_seed.as_mut().map(|field| field as _)
17867 }
17868 pub fn address_seed_mut(&mut self) -> &mut String {
17871 self.address_seed.get_or_insert_default()
17872 }
17873 pub fn address_seed_opt(&self) -> Option<&str> {
17875 self.address_seed.as_ref().map(|field| field as _)
17876 }
17877 pub fn set_address_seed<T: Into<String>>(&mut self, field: T) {
17879 self.address_seed = Some(field.into().into());
17880 }
17881 pub fn with_address_seed<T: Into<String>>(mut self, field: T) -> Self {
17883 self.set_address_seed(field.into());
17884 self
17885 }
17886 }
17887}