pub struct SynapClient { /* private fields */ }Expand description
Main Synap client.
Internally uses one of three transports — SynapRPC (default), RESP3, or
HTTP — selected via SynapConfig::transport. Commands that have no
native-protocol mapping automatically fall back to HTTP regardless of the
chosen transport.
Implementations§
Source§impl SynapClient
impl SynapClient
Sourcepub fn new(config: SynapConfig) -> Result<Self>
pub fn new(config: SynapConfig) -> Result<Self>
Create a new Synap client using the provided configuration.
Sourcepub fn hash(&self) -> HashManager
pub fn hash(&self) -> HashManager
Get the Hash manager interface.
Sourcepub fn list(&self) -> ListManager
pub fn list(&self) -> ListManager
Get the List manager interface.
Sourcepub fn set(&self) -> SetManager
pub fn set(&self) -> SetManager
Get the Set manager interface.
Sourcepub fn sorted_set(&self) -> SortedSetManager
pub fn sorted_set(&self) -> SortedSetManager
Get the Sorted Set manager interface.
Sourcepub fn queue(&self) -> QueueManager
pub fn queue(&self) -> QueueManager
Get the Queue manager interface.
Sourcepub fn stream(&self) -> StreamManager
pub fn stream(&self) -> StreamManager
Get the Stream manager interface.
Sourcepub fn pubsub(&self) -> PubSubManager
pub fn pubsub(&self) -> PubSubManager
Get the Pub/Sub manager interface.
Sourcepub fn transaction(&self) -> TransactionManager
pub fn transaction(&self) -> TransactionManager
Get the Transaction manager interface.
Sourcepub fn script(&self) -> ScriptManager
pub fn script(&self) -> ScriptManager
Get the Scripting manager interface.
Sourcepub fn hyperloglog(&self) -> HyperLogLogManager
pub fn hyperloglog(&self) -> HyperLogLogManager
Get the HyperLogLog manager interface.
Sourcepub fn bitmap(&self) -> BitmapManager
pub fn bitmap(&self) -> BitmapManager
Get the Bitmap manager interface.
Sourcepub fn geospatial(&self) -> GeospatialManager
pub fn geospatial(&self) -> GeospatialManager
Get the Geospatial manager interface.
Sourcepub async fn send_command(&self, command: &str, payload: Value) -> Result<Value>
pub async fn send_command(&self, command: &str, payload: Value) -> Result<Value>
Dispatch a command to the active transport.
For SynapRPC and RESP3 transports every command must have a native
mapping in the transport mapper. Unmapped commands return
SynapError::UnsupportedCommand — there is no silent HTTP fallback.
Use an http:// URL if you need HTTP REST for a command that is not
yet in the mapper.
Trait Implementations§
Source§impl Clone for SynapClient
impl Clone for SynapClient
Source§fn clone(&self) -> SynapClient
fn clone(&self) -> SynapClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more