pub trait Routable {
    // Required methods
    fn arg_idx(&self, idx: usize) -> Option<&[u8]>;
    fn position(&self, candidate: &[u8]) -> Option<usize>;

    // Provided method
    fn command(&self) -> Option<Vec<u8>> { ... }
}
Expand description

Objects that implement this trait define a request that can be routed by a cluster client to different nodes in the cluster.

Required Methods§

source

fn arg_idx(&self, idx: usize) -> Option<&[u8]>

Returns a reference to the data for the argument at idx.

source

fn position(&self, candidate: &[u8]) -> Option<usize>

Returns index of argument that matches candidate, if it exists

Provided Methods§

source

fn command(&self) -> Option<Vec<u8>>

Convenience function to return ascii uppercase version of the the first argument (i.e., the command).

Implementors§