#[non_exhaustive]pub struct KeyRecipe {
pub part: Vec<Part>,
pub target: Option<Target>,
/* private fields */
}Expand description
A KeyRecipe provides the metadata required to translate reads, mutations,
and queries into a byte array in “sortable string format” (ssformat)that can
be used with Ranges to route requests. Note that the client must tolerate
KeyRecipes that appear to be invalid, since the KeyRecipe format may
change over time. Requests with invalid KeyRecipes should be routed to a
default server.
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.part: Vec<Part>Parts are in the order they should appear in the encoded key.
target: Option<Target>A recipe can be associated with a table, index, or query. Tables recipes are used to encode read and write keys; index recipes are used for index reads, and query recipes are used only for SQL queries.
Implementations§
Source§impl KeyRecipe
impl KeyRecipe
Sourcepub fn set_target<T: Into<Option<Target>>>(self, v: T) -> Self
pub fn set_target<T: Into<Option<Target>>>(self, v: T) -> Self
Sets the value of target.
Note that all the setters affecting target are mutually
exclusive.
Sourcepub fn table_name(&self) -> Option<&String>
pub fn table_name(&self) -> Option<&String>
The value of target
if it holds a TableName, None if the field is not set or
holds a different branch.
Sourcepub fn set_table_name<T: Into<String>>(self, v: T) -> Self
pub fn set_table_name<T: Into<String>>(self, v: T) -> Self
Sets the value of target
to hold a TableName.
Note that all the setters affecting target are
mutually exclusive.
Sourcepub fn index_name(&self) -> Option<&String>
pub fn index_name(&self) -> Option<&String>
The value of target
if it holds a IndexName, None if the field is not set or
holds a different branch.
Sourcepub fn set_index_name<T: Into<String>>(self, v: T) -> Self
pub fn set_index_name<T: Into<String>>(self, v: T) -> Self
Sets the value of target
to hold a IndexName.
Note that all the setters affecting target are
mutually exclusive.
Sourcepub fn operation_uid(&self) -> Option<&u64>
pub fn operation_uid(&self) -> Option<&u64>
The value of target
if it holds a OperationUid, None if the field is not set or
holds a different branch.
Sourcepub fn set_operation_uid<T: Into<u64>>(self, v: T) -> Self
pub fn set_operation_uid<T: Into<u64>>(self, v: T) -> Self
Sets the value of target
to hold a OperationUid.
Note that all the setters affecting target are
mutually exclusive.
Trait Implementations§
impl StructuralPartialEq for KeyRecipe
Auto Trait Implementations§
impl Freeze for KeyRecipe
impl RefUnwindSafe for KeyRecipe
impl Send for KeyRecipe
impl Sync for KeyRecipe
impl Unpin for KeyRecipe
impl UnsafeUnpin for KeyRecipe
impl UnwindSafe for KeyRecipe
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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