pub struct Target {
pub target_id: i32,
pub once: bool,
pub expected_count: Option<i32>,
pub target_type: Option<TargetType>,
pub resume_type: Option<ResumeType>,
}
Expand description
A specification of a set of documents to listen to.
Fields§
§target_id: i32
The target ID that identifies the target on the stream. Must be a positive number and non-zero.
If target_id
is 0 (or unspecified), the server will assign an ID for this
target and return that in a TargetChange::ADD
event. Once a target with
target_id=0
is added, all subsequent targets must also have
target_id=0
. If an AddTarget
request with target_id != 0
is
sent to the server after a target with target_id=0
is added, the server
will immediately send a response with a TargetChange::Remove
event.
Note that if the client sends multiple AddTarget
requests
without an ID, the order of IDs returned in TargetChage.target_ids
are
undefined. Therefore, clients should provide a target ID instead of relying
on the server to assign one.
If target_id
is non-zero, there must not be an existing active target on
this stream with the same ID.
once: bool
If the target should be removed once it is current and consistent.
expected_count: Option<i32>
The number of documents that last matched the query at the resume token or read time.
This value is only relevant when a resume_type
is provided. This value
being present and greater than zero signals that the client wants
ExistenceFilter.unchanged_names
to be included in the response.
target_type: Option<TargetType>
The type of target to listen to.
resume_type: Option<ResumeType>
When to start listening.
If specified, only the matching Documents that have been updated AFTER the
resume_token
or read_time
will be returned. Otherwise, all matching
Documents are returned before any subsequent changes.
Trait Implementations§
source§impl Message for Target
impl Message for Target
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Target
impl PartialEq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl !Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request