JetstreamConfig

Struct JetstreamConfig 

Source
pub struct JetstreamConfig {
    pub endpoint: String,
    pub wanted_collections: Vec<Nsid>,
    pub wanted_dids: Vec<Did>,
    pub compression: JetstreamCompression,
    pub cursor: Option<DateTime<Utc>>,
    pub max_retries: u32,
    pub max_delay_ms: u64,
    pub base_delay_ms: u64,
    pub reset_retries_min_ms: u64,
}

Fields§

§endpoint: String

A Jetstream endpoint to connect to with a WebSocket Scheme i.e. wss://jetstream1.us-east.bsky.network/subscribe.

§wanted_collections: Vec<Nsid>

A list of collection NSIDs to filter events for.

An empty list will receive events for all collections.

Regardless of desired collections, all subscribers receive AccountEvent and IdentityEvent events.

§wanted_dids: Vec<Did>

A list of repo DIDs to filter events for.

An empty list will receive events for all repos, which is a lot of events!

§compression: JetstreamCompression

The compression algorithm to request and use for the WebSocket connection (if any).

§cursor: Option<DateTime<Utc>>

An optional timestamp to begin playback from.

An absent cursor or a cursor from the future will result in live-tail operation.

When reconnecting, use the time_us from your most recently processed event and maybe provide a negative buffer (i.e. subtract a few seconds) to ensure gapless playback.

§max_retries: u32§max_delay_ms: u64§base_delay_ms: u64§reset_retries_min_ms: u64

Implementations§

Source§

impl JetstreamConfig

Source

pub fn construct_endpoint(&self, endpoint: &str) -> Result<Url, ParseError>

Constructs a new endpoint URL with the given JetstreamConfig applied.

Source

pub fn validate(&self) -> Result<(), ConfigValidationError>

Validates the configuration to make sure it is within the limits of the Jetstream API.

§Constants

The following constants are used to validate the configuration and should only be changed if the Jetstream API has itself changed.

  • [MAX_WANTED_COLLECTIONS]
  • [MAX_WANTED_DIDS]

Trait Implementations§

Source§

impl Default for JetstreamConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V