#[non_exhaustive]pub struct Options {
pub squash: Option<Squash>,
pub changefeed_queue_size: Option<u32>,
pub include_initial: Option<bool>,
pub include_states: Option<bool>,
pub include_offsets: Option<bool>,
pub include_types: Option<bool>,
}
Expand description
Optional arguments to changes
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.squash: Option<Squash>
Controls how change notifications are batched
changefeed_queue_size: Option<u32>
The number of changes the server will buffer between client reads before it starts dropping changes and generates an error (default: 100,000).
include_initial: Option<bool>
If true
, the changefeed stream will begin with the current contents
of the table or selection being monitored. These initial results will
have new_val
fields, but no old_val
fields. The initial results
may be intermixed with actual changes, as long as an initial result
for the changed document has already been given. If an initial result
for a document has been sent and a change is made to that document
that would move it to the unsent part of the result set (e.g., a
changefeed monitors the top 100 posters, the first 50 have been sent,
and poster 48 has become poster 52), an “uninitial” notification will
be sent, with an old_val
field but no new_val
field.
include_states: Option<bool>
If true
, the changefeed stream will include special status documents
consisting of the field state
and a string indicating a change in the
feed’s state. These documents can occur at any point in the feed between
the notification documents described below. If includeStates
is false
(the default), the status documents will not be sent.
include_offsets: Option<bool>
If true
, a changefeed stream on an order_by.limit
changefeed will
include old_offset
and new_offset
fields in status documents that
include old_val
and new_val
. This allows applications to maintain
ordered lists of the stream’s result set. If old_offset
is set and not
null
, the element at old_offset
is being deleted; if new_offset
is
set and not null
, then new_val
is being inserted at new_offset
.
Setting include_offsets
to true
on a changefeed that does not support
it will raise an error.
include_types: Option<bool>
If true
, every result on a changefeed will include a type
field with
a string that indicates the kind of change the result represents:
add
, remove
, change
, initial
, uninitial
, state
.
Defaults to false
.
There are currently two states:
{state: 'initializing'}
indicates the following documents represent initial values on the feed rather than changes. This will be the first document of a feed that returns initial values.{state: 'ready'}
indicates the following documents represent changes. This will be the first document of a feed that does not return initial values; otherwise, it will indicate the initial values have all been sent.
Implementations
sourceimpl Options
impl Options
pub fn new() -> Self
pub fn squash(self, squash: Squash) -> Self
pub fn changefeed_queue_size(self, changefeed_queue_size: u32) -> Self
pub fn include_initial(self, include_initial: bool) -> Self
pub fn include_states(self, include_states: bool) -> Self
pub fn include_offsets(self, include_offsets: bool) -> Self
pub fn include_types(self, include_types: bool) -> Self
Trait Implementations
sourceimpl PartialOrd<Options> for Options
impl PartialOrd<Options> for Options
sourcefn partial_cmp(&self, other: &Options) -> Option<Ordering>
fn partial_cmp(&self, other: &Options) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Options
impl StructuralPartialEq for Options
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more