pub struct Target {
pub documents: Option<DocumentsTarget>,
pub expected_count: Option<i32>,
pub once: Option<bool>,
pub query: Option<QueryTarget>,
pub read_time: Option<DateTime<Utc>>,
pub resume_token: Option<Vec<u8>>,
pub target_id: Option<i32>,
}
Expand description
A specification of a set of documents to listen to.
This type is not used in any activity, and only used as part of another schema.
Fields§
§documents: Option<DocumentsTarget>
A target specified by a set of document names.
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.
once: Option<bool>
If the target should be removed once it is current and consistent.
query: Option<QueryTarget>
A target specified by a query.
read_time: Option<DateTime<Utc>>
Start listening after a specific read_time
. The client must know the state of matching documents at this time.
resume_token: Option<Vec<u8>>
A resume token from a prior TargetChange for an identical target. Using a resume token with a different target is unsupported and may fail.
target_id: Option<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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Part 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more