pub struct SubscriptionOptionsBuilder { /* private fields */ }Expand description
Fluent builder for SubscriptionOptions.
Per CLAUDE.md §2 Self::new takes no parameters, every parameter has a
fluent setter, and Self::build validates the mandatory ones — returning
Error::LocalIllegalArgument if they were not set. Like SubscriptionOptions it has no Java counterpart and
exists solely to satisfy that naming rule (DoD #7).
Implementations§
Source§impl SubscriptionOptionsBuilder
impl SubscriptionOptionsBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder with every mandatory parameter unset and every other parameter at the value Java passes on the caller’s behalf.
Sourcepub fn set_topics(self, topics: Vec<String>) -> Self
pub fn set_topics(self, topics: Vec<String>) -> Self
Sets SubscriptionOptions::topics, a mandatory parameter: Self::build
panics if it was not set.
Sourcepub fn set_user_data(self, user_data: Option<Vec<u8>>) -> Self
pub fn set_user_data(self, user_data: Option<Vec<u8>>) -> Self
Sets SubscriptionOptions::user_data.
Sourcepub fn set_owned_partitions(self, owned_partitions: Vec<TopicPartition>) -> Self
pub fn set_owned_partitions(self, owned_partitions: Vec<TopicPartition>) -> Self
Sets SubscriptionOptions::owned_partitions.
Sourcepub fn set_generation_id(self, generation_id: i32) -> Self
pub fn set_generation_id(self, generation_id: i32) -> Self
Sets SubscriptionOptions::generation_id.
Sourcepub fn set_rack_id(self, rack_id: Option<String>) -> Self
pub fn set_rack_id(self, rack_id: Option<String>) -> Self
Sets SubscriptionOptions::rack_id.
Sourcepub fn build(self) -> Result<SubscriptionOptions, Error>
pub fn build(self) -> Result<SubscriptionOptions, Error>
Returns the built options.
Per CLAUDE.md §2 the mandatory parameters are validated here rather than
being named in the constructor, so a later Java version that makes one of
them optional changes the set this accepts instead of adding a second
constructor. Today there is one mandatory set: topics.
§Errors
Returns Error::LocalIllegalArgument naming the first parameter of that
set which was not given a setter call. Only presence is checked here;
semantic validation belongs to the method the options are passed to
(CLAUDE.md §2).