Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 188 additions & 0 deletions crates/sui-rpc/src/proto/generated/sui.rpc.v2.accessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10794,6 +10794,194 @@ mod _accessor_impls {
self
}
}
impl super::ListPackagesRequest {
pub const fn const_default() -> Self {
Self {
start_checkpoint: None,
end_checkpoint: None,
options: None,
}
}
#[doc(hidden)]
pub fn default_instance() -> &'static Self {
static DEFAULT: super::ListPackagesRequest = super::ListPackagesRequest::const_default();
&DEFAULT
}
///If `start_checkpoint` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
pub fn start_checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
self.start_checkpoint.as_mut().map(|field| field as _)
}
///Returns a mutable reference to `start_checkpoint`.
///If the field is unset, it is first initialized with the default value.
pub fn start_checkpoint_mut(&mut self) -> &mut u64 {
self.start_checkpoint.get_or_insert_default()
}
///If `start_checkpoint` is set, returns [`Some`] with the value; otherwise returns [`None`].
pub fn start_checkpoint_opt(&self) -> Option<u64> {
self.start_checkpoint.as_ref().map(|field| *field)
}
///Sets `start_checkpoint` with the provided value.
pub fn set_start_checkpoint(&mut self, field: u64) {
self.start_checkpoint = Some(field);
}
///Sets `start_checkpoint` with the provided value.
pub fn with_start_checkpoint(mut self, field: u64) -> Self {
self.set_start_checkpoint(field);
self
}
///If `end_checkpoint` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
pub fn end_checkpoint_opt_mut(&mut self) -> Option<&mut u64> {
self.end_checkpoint.as_mut().map(|field| field as _)
}
///Returns a mutable reference to `end_checkpoint`.
///If the field is unset, it is first initialized with the default value.
pub fn end_checkpoint_mut(&mut self) -> &mut u64 {
self.end_checkpoint.get_or_insert_default()
}
///If `end_checkpoint` is set, returns [`Some`] with the value; otherwise returns [`None`].
pub fn end_checkpoint_opt(&self) -> Option<u64> {
self.end_checkpoint.as_ref().map(|field| *field)
}
///Sets `end_checkpoint` with the provided value.
pub fn set_end_checkpoint(&mut self, field: u64) {
self.end_checkpoint = Some(field);
}
///Sets `end_checkpoint` with the provided value.
pub fn with_end_checkpoint(mut self, field: u64) -> Self {
self.set_end_checkpoint(field);
self
}
///Returns the value of `options`, or the default value if `options` is unset.
pub fn options(&self) -> &super::QueryOptions {
self.options
.as_ref()
.map(|field| field as _)
.unwrap_or_else(|| super::QueryOptions::default_instance() as _)
}
///If `options` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
pub fn options_opt_mut(&mut self) -> Option<&mut super::QueryOptions> {
self.options.as_mut().map(|field| field as _)
}
///Returns a mutable reference to `options`.
///If the field is unset, it is first initialized with the default value.
pub fn options_mut(&mut self) -> &mut super::QueryOptions {
self.options.get_or_insert_default()
}
///If `options` is set, returns [`Some`] with the value; otherwise returns [`None`].
pub fn options_opt(&self) -> Option<&super::QueryOptions> {
self.options.as_ref().map(|field| field as _)
}
///Sets `options` with the provided value.
pub fn set_options<T: Into<super::QueryOptions>>(&mut self, field: T) {
self.options = Some(field.into().into());
}
///Sets `options` with the provided value.
pub fn with_options<T: Into<super::QueryOptions>>(mut self, field: T) -> Self {
self.set_options(field.into());
self
}
}
impl super::ListPackagesResponse {
pub const fn const_default() -> Self {
Self {
package: None,
watermark: None,
end: None,
}
}
#[doc(hidden)]
pub fn default_instance() -> &'static Self {
static DEFAULT: super::ListPackagesResponse = super::ListPackagesResponse::const_default();
&DEFAULT
}
///Returns the value of `package`, or the default value if `package` is unset.
pub fn package(&self) -> &super::PackageVersion {
self.package
.as_ref()
.map(|field| field as _)
.unwrap_or_else(|| super::PackageVersion::default_instance() as _)
}
///If `package` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
pub fn package_opt_mut(&mut self) -> Option<&mut super::PackageVersion> {
self.package.as_mut().map(|field| field as _)
}
///Returns a mutable reference to `package`.
///If the field is unset, it is first initialized with the default value.
pub fn package_mut(&mut self) -> &mut super::PackageVersion {
self.package.get_or_insert_default()
}
///If `package` is set, returns [`Some`] with the value; otherwise returns [`None`].
pub fn package_opt(&self) -> Option<&super::PackageVersion> {
self.package.as_ref().map(|field| field as _)
}
///Sets `package` with the provided value.
pub fn set_package<T: Into<super::PackageVersion>>(&mut self, field: T) {
self.package = Some(field.into().into());
}
///Sets `package` with the provided value.
pub fn with_package<T: Into<super::PackageVersion>>(mut self, field: T) -> Self {
self.set_package(field.into());
self
}
///Returns the value of `watermark`, or the default value if `watermark` is unset.
pub fn watermark(&self) -> &super::Watermark {
self.watermark
.as_ref()
.map(|field| field as _)
.unwrap_or_else(|| super::Watermark::default_instance() as _)
}
///If `watermark` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
pub fn watermark_opt_mut(&mut self) -> Option<&mut super::Watermark> {
self.watermark.as_mut().map(|field| field as _)
}
///Returns a mutable reference to `watermark`.
///If the field is unset, it is first initialized with the default value.
pub fn watermark_mut(&mut self) -> &mut super::Watermark {
self.watermark.get_or_insert_default()
}
///If `watermark` is set, returns [`Some`] with the value; otherwise returns [`None`].
pub fn watermark_opt(&self) -> Option<&super::Watermark> {
self.watermark.as_ref().map(|field| field as _)
}
///Sets `watermark` with the provided value.
pub fn set_watermark<T: Into<super::Watermark>>(&mut self, field: T) {
self.watermark = Some(field.into().into());
}
///Sets `watermark` with the provided value.
pub fn with_watermark<T: Into<super::Watermark>>(mut self, field: T) -> Self {
self.set_watermark(field.into());
self
}
///Returns the value of `end`, or the default value if `end` is unset.
pub fn end(&self) -> &super::QueryEnd {
self.end
.as_ref()
.map(|field| field as _)
.unwrap_or_else(|| super::QueryEnd::default_instance() as _)
}
///If `end` is set, returns [`Some`] with a mutable reference to the value; otherwise returns [`None`].
pub fn end_opt_mut(&mut self) -> Option<&mut super::QueryEnd> {
self.end.as_mut().map(|field| field as _)
}
///Returns a mutable reference to `end`.
///If the field is unset, it is first initialized with the default value.
pub fn end_mut(&mut self) -> &mut super::QueryEnd {
self.end.get_or_insert_default()
}
///If `end` is set, returns [`Some`] with the value; otherwise returns [`None`].
pub fn end_opt(&self) -> Option<&super::QueryEnd> {
self.end.as_ref().map(|field| field as _)
}
///Sets `end` with the provided value.
pub fn set_end<T: Into<super::QueryEnd>>(&mut self, field: T) {
self.end = Some(field.into().into());
}
///Sets `end` with the provided value.
pub fn with_end<T: Into<super::QueryEnd>>(mut self, field: T) -> Self {
self.set_end(field.into());
self
}
}
impl super::ListTransactionsRequest {
pub const fn const_default() -> Self {
Self {
Expand Down
Binary file modified crates/sui-rpc/src/proto/generated/sui.rpc.v2.fds.bin
Binary file not shown.
120 changes: 120 additions & 0 deletions crates/sui-rpc/src/proto/generated/sui.rpc.v2.field_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6051,6 +6051,126 @@ pub(crate) mod _field_impls {
self.finish()
}
}
impl ListPackagesRequest {
pub const START_CHECKPOINT_FIELD: &'static MessageField = &MessageField {
name: "start_checkpoint",
json_name: "startCheckpoint",
number: 1i32,
message_fields: None,
};
pub const END_CHECKPOINT_FIELD: &'static MessageField = &MessageField {
name: "end_checkpoint",
json_name: "endCheckpoint",
number: 2i32,
message_fields: None,
};
pub const OPTIONS_FIELD: &'static MessageField = &MessageField {
name: "options",
json_name: "options",
number: 3i32,
message_fields: Some(QueryOptions::FIELDS),
};
}
impl MessageFields for ListPackagesRequest {
const FIELDS: &'static [&'static MessageField] = &[
Self::START_CHECKPOINT_FIELD,
Self::END_CHECKPOINT_FIELD,
Self::OPTIONS_FIELD,
];
}
impl ListPackagesRequest {
pub fn path_builder() -> ListPackagesRequestFieldPathBuilder {
ListPackagesRequestFieldPathBuilder::new()
}
}
pub struct ListPackagesRequestFieldPathBuilder {
path: Vec<&'static str>,
}
impl ListPackagesRequestFieldPathBuilder {
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self { path: Default::default() }
}
#[doc(hidden)]
pub fn new_with_base(base: Vec<&'static str>) -> Self {
Self { path: base }
}
pub fn finish(self) -> String {
self.path.join(".")
}
pub fn start_checkpoint(mut self) -> String {
self.path.push(ListPackagesRequest::START_CHECKPOINT_FIELD.name);
self.finish()
}
pub fn end_checkpoint(mut self) -> String {
self.path.push(ListPackagesRequest::END_CHECKPOINT_FIELD.name);
self.finish()
}
pub fn options(mut self) -> QueryOptionsFieldPathBuilder {
self.path.push(ListPackagesRequest::OPTIONS_FIELD.name);
QueryOptionsFieldPathBuilder::new_with_base(self.path)
}
}
impl ListPackagesResponse {
pub const PACKAGE_FIELD: &'static MessageField = &MessageField {
name: "package",
json_name: "package",
number: 1i32,
message_fields: Some(PackageVersion::FIELDS),
};
pub const WATERMARK_FIELD: &'static MessageField = &MessageField {
name: "watermark",
json_name: "watermark",
number: 2i32,
message_fields: Some(Watermark::FIELDS),
};
pub const END_FIELD: &'static MessageField = &MessageField {
name: "end",
json_name: "end",
number: 3i32,
message_fields: Some(QueryEnd::FIELDS),
};
}
impl MessageFields for ListPackagesResponse {
const FIELDS: &'static [&'static MessageField] = &[
Self::PACKAGE_FIELD,
Self::WATERMARK_FIELD,
Self::END_FIELD,
];
}
impl ListPackagesResponse {
pub fn path_builder() -> ListPackagesResponseFieldPathBuilder {
ListPackagesResponseFieldPathBuilder::new()
}
}
pub struct ListPackagesResponseFieldPathBuilder {
path: Vec<&'static str>,
}
impl ListPackagesResponseFieldPathBuilder {
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self { path: Default::default() }
}
#[doc(hidden)]
pub fn new_with_base(base: Vec<&'static str>) -> Self {
Self { path: base }
}
pub fn finish(self) -> String {
self.path.join(".")
}
pub fn package(mut self) -> PackageVersionFieldPathBuilder {
self.path.push(ListPackagesResponse::PACKAGE_FIELD.name);
PackageVersionFieldPathBuilder::new_with_base(self.path)
}
pub fn watermark(mut self) -> WatermarkFieldPathBuilder {
self.path.push(ListPackagesResponse::WATERMARK_FIELD.name);
WatermarkFieldPathBuilder::new_with_base(self.path)
}
pub fn end(mut self) -> QueryEndFieldPathBuilder {
self.path.push(ListPackagesResponse::END_FIELD.name);
QueryEndFieldPathBuilder::new_with_base(self.path)
}
}
impl LookupNameRequest {
pub const NAME_FIELD: &'static MessageField = &MessageField {
name: "name",
Expand Down
Loading
Loading