pub struct Node { /* private fields */ }Expand description
Information about a Kafka node.
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(id: i32, host: String, port: i32) -> Self
pub fn new(id: i32, host: String, port: i32) -> Self
Creates a new Node with no rack and not fenced.
§Arguments
id- the node idhost- the host nameport- the port
Sourcepub fn with_rack(id: i32, host: String, port: i32, rack: Option<String>) -> Self
pub fn with_rack(id: i32, host: String, port: i32, rack: Option<String>) -> Self
Creates a new Node with the given rack.
§Arguments
id- the node idhost- the host nameport- the portrack- the rack, orNoneif unknown
Sourcepub fn with_rack_is_fenced(
id: i32,
host: String,
port: i32,
rack: Option<String>,
is_fenced: bool,
) -> Self
pub fn with_rack_is_fenced( id: i32, host: String, port: i32, rack: Option<String>, is_fenced: bool, ) -> Self
Creates a new Node with the given rack and fenced status.
§Arguments
id- the node idhost- the host nameport- the portrack- the rack, orNoneif unknownis_fenced- whether the broker is fenced
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Check whether this node is empty, which may be the case if no_node() is used
as a placeholder in a response payload with an error.
§Returns
true if it is, false otherwise
Trait Implementations§
Source§impl PartialEq for Node
Java’s Node.equals first requires
getClass() == obj.getClass(), so a GroupCoordinatorNode never equals a
plain Node with the same fields. Rust has no subclass to compare, so
id_string stands in for the class: a plain node’s is id.to_string() and
a group coordinator’s is "+" + id, so for equal ids the two id_strings
are equal exactly when the Java classes are. Hash leaves it out, as Java’s
hashCode leaves the class out; equal values still hash equally.
impl PartialEq for Node
Java’s Node.equals first requires
getClass() == obj.getClass(), so a GroupCoordinatorNode never equals a
plain Node with the same fields. Rust has no subclass to compare, so
id_string stands in for the class: a plain node’s is id.to_string() and
a group coordinator’s is "+" + id, so for equal ids the two id_strings
are equal exactly when the Java classes are. Hash leaves it out, as Java’s
hashCode leaves the class out; equal values still hash equally.
impl Eq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.