Struct fluvio::Fluvio[][src]

pub struct Fluvio { /* fields omitted */ }
Expand description

An interface for interacting with Fluvio streaming

Implementations

Creates a new Fluvio client using the current profile from ~/.fluvio/config

If there is no current profile or the ~/.fluvio/config file does not exist, then this will create a new profile with default settings and set it as current, then try to connect to the cluster using those settings.

Example

let fluvio = Fluvio::connect().await?;

Creates a new Fluvio client with the given configuration

Example

use fluvio::config::ConfigFile;
let config_file = ConfigFile::load_default_or_new()?;
let config = config_file.config().current_cluster().unwrap();
let fluvio = Fluvio::connect_with_config(&config).await?;

Creates a new TopicProducer for the given topic name

Currently, producers are scoped to a specific Fluvio topic. That means when you send events via a producer, you must specify which partition each event should go to.

Example

let producer = fluvio.topic_producer("my-topic").await?;
producer.send(RecordKey::NULL, "Hello, Fluvio!").await?;

Creates a new PartitionConsumer for the given topic and partition

Currently, consumers are scoped to both a specific Fluvio topic and to a particular partition within that topic. That means that if you have a topic with multiple partitions, then in order to receive all of the events in all of the partitions, you will need to create one consumer per partition.

Example

let consumer_one = fluvio.partition_consumer("my-topic", 0).await?;
let consumer_two = fluvio.partition_consumer("my-topic", 1).await?;

let records_one = consumer_one.fetch(Offset::beginning()).await?;
let records_two = consumer_two.fetch(Offset::beginning()).await?;

Provides an interface for managing a Fluvio cluster

Example

let admin = fluvio.admin().await;

Reports the Platform Version of the connected cluster.

The “Platform Version” is the value of the VERSION file when the cluster components were compiled, and is a semver value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.