pub struct FalkorAsyncClient { /* private fields */ }Expand description
This is the publicly exposed API of the asynchronous Falkor Client It makes no assumptions in regard to which database the Falkor module is running on, and will select it based on enabled features and url connection
§Thread Safety
This struct is fully thread safe, it can be cloned and passed between threads without constraints, Its API uses only immutable references
Implementations§
Source§impl FalkorAsyncClient
impl FalkorAsyncClient
Sourcepub fn connection_pool_size(&self) -> u8
pub fn connection_pool_size(&self) -> u8
Get the number of underlying connections this client maintains (pool size for the pooled strategy, or the number of multiplexed sockets).
Sourcepub fn connection_strategy(&self) -> ConnectionStrategy
pub fn connection_strategy(&self) -> ConnectionStrategy
The effective ConnectionStrategy this client is running.
Sourcepub fn replica_reads_available(&self) -> bool
pub fn replica_reads_available(&self) -> bool
Whether replica connections are available for routing read-only queries — true only for
Redis Sentinel deployments that expose readable replicas.
This reports capability, not policy: a query is served from a replica only when this is
true and the effective ReadPreference is
PreferReplica. Use read_preference
to inspect the client’s default policy.
Sourcepub fn read_preference(&self) -> ReadPreference
pub fn read_preference(&self) -> ReadPreference
The client-wide default ReadPreference applied to read-only queries (set via
FalkorClientBuilder::with_read_preference;
defaults to ReadPreference::Primary). Individual queries can override it.
Sourcepub fn reads_from_replicas(&self) -> bool
👎Deprecated since 0.10.0: renamed to replica_reads_available (reports replica capability). Since replica routing is now opt-in, use read_preference to inspect the routing policy.
pub fn reads_from_replicas(&self) -> bool
renamed to replica_reads_available (reports replica capability). Since replica routing is now opt-in, use read_preference to inspect the routing policy.
Whether read-only queries (ro_query / call_procedure_ro) are routed to
replica nodes. This is true only for Redis Sentinel deployments that expose
readable replicas; otherwise read-only queries are served by the primary.
Sourcepub async fn list_graphs(&self) -> FalkorResult<Vec<String>>
pub async fn list_graphs(&self) -> FalkorResult<Vec<String>>
Sourcepub async fn config_get(
&self,
config_key: &str,
) -> FalkorResult<HashMap<String, ConfigValue>>
pub async fn config_get( &self, config_key: &str, ) -> FalkorResult<HashMap<String, ConfigValue>>
Sourcepub async fn config_set<C: Into<ConfigValue>>(
&self,
config_key: &str,
value: C,
) -> FalkorResult<Value>
pub async fn config_set<C: Into<ConfigValue>>( &self, config_key: &str, value: C, ) -> FalkorResult<Value>
Return the current value of a configuration option in the database.
§Arguments
config_Key: AStringrepresentation of a configuration’s key. The config key can also be “*”, which will return ALL the configuration options.value: The new value to set, which is anything that can be converted into aConfigValue, namely string types and i64.
Sourcepub fn select_graph<T: ToString>(&self, graph_name: T) -> AsyncGraph
pub fn select_graph<T: ToString>(&self, graph_name: T) -> AsyncGraph
Opens a graph context for queries and operations
§Arguments
graph_name: A string identifier of the graph to open.
§Returns
a AsyncGraph object, allowing various graph operations.
Sourcepub async fn copy_graph(
&self,
graph_to_clone: &str,
new_graph_name: &str,
) -> FalkorResult<AsyncGraph>
pub async fn copy_graph( &self, graph_to_clone: &str, new_graph_name: &str, ) -> FalkorResult<AsyncGraph>
Copies an entire graph and returns the AsyncGraph for the new copied graph.
§Arguments
graph_to_clone: A string identifier of the graph to copy.new_graph_name: The name to give the new graph.
§Returns
If successful, will return the new AsyncGraph object.
Sourcepub async fn redis_info(
&self,
section: Option<&str>,
) -> FalkorResult<HashMap<String, String>>
pub async fn redis_info( &self, section: Option<&str>, ) -> FalkorResult<HashMap<String, String>>
Retrieves redis information
Sourcepub async fn udf_load(
&self,
name: &str,
script: &str,
replace: bool,
) -> FalkorResult<Value>
pub async fn udf_load( &self, name: &str, script: &str, replace: bool, ) -> FalkorResult<Value>
Load a User Defined Function (UDF) library.
§Arguments
name: The name of the library to load.script: The UDF script contents.replace: If true, replace an existing library with the same name.
§Returns
A redis::Value indicating the result of the operation.
Sourcepub async fn udf_list(
&self,
lib: Option<&str>,
with_code: bool,
) -> FalkorResult<Value>
pub async fn udf_list( &self, lib: Option<&str>, with_code: bool, ) -> FalkorResult<Value>
List User Defined Function (UDF) libraries.
§Arguments
lib: If provided, filter the list to this specific library.with_code: If true, include the library source code in the result.
§Returns
A redis::Value containing the list of UDF libraries and their metadata.
Sourcepub async fn udf_flush(&self) -> FalkorResult<Value>
pub async fn udf_flush(&self) -> FalkorResult<Value>
Flush (remove) all User Defined Function (UDF) libraries.
§Returns
A redis::Value indicating the result of the operation.
Sourcepub async fn udf_delete(&self, lib: &str) -> FalkorResult<Value>
pub async fn udf_delete(&self, lib: &str) -> FalkorResult<Value>
Delete a User Defined Function (UDF) library.
§Arguments
lib: The name of the library to delete.
§Returns
A redis::Value indicating the result of the operation.
Source§impl FalkorAsyncClient
impl FalkorAsyncClient
Sourcepub fn copy_graph_op(
&self,
graph_to_clone: &str,
new_graph_name: &str,
) -> AsyncCopyGraphBuilder<'_>
pub fn copy_graph_op( &self, graph_to_clone: &str, new_graph_name: &str, ) -> AsyncCopyGraphBuilder<'_>
Returns a builder for copying a graph, supporting .execute() (single attempt) and
.wait() (retry transient could not fork failures). Mirrors
FalkorAsyncClient::copy_graph.
Trait Implementations§
Source§impl Clone for FalkorAsyncClient
impl Clone for FalkorAsyncClient
Source§fn clone(&self) -> FalkorAsyncClient
fn clone(&self) -> FalkorAsyncClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more