#[non_exhaustive]pub struct ColumnFamilyMapping {
pub key_definition: Option<KeyDefinition>,
/* private fields */
}Expand description
Configuration for writing a Pub/Sub message to a Bigtable row with a user-defined key and writing to column families.
If this field is set:
- The subscription messages must be formatted as JSON.
- The row key mapping is configured in the
key_definitionsection. - The top-level fields will be written either:
- By default, they will be written to the
datacolumn family with the field name as the column qualifier. - But if the field name matches an existing column family (except for
the default
datacolumn), then that field will be written to that column family, either as a scalar or its next level nested fields if it’s a JSON object.
- By default, they will be written to the
- The cell timestamp will be the message publish timestamp.
If the field is not set, the default behavior is to write:
- row key: subscription name, message ID hash, and message ID delimited by
#. - columns: message bytes written to a single column family
datawith an empty-string column qualifier. - cell timestamp: the message publish timestamp.
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.key_definition: Option<KeyDefinition>How to construct the row key from the Pub/Sub message.
If not specified, the default behavior is to construct the row key from
the subscription name, message ID hash, and message ID delimited by #.
Implementations§
Source§impl ColumnFamilyMapping
impl ColumnFamilyMapping
Sourcepub fn set_key_definition<T: Into<Option<KeyDefinition>>>(self, v: T) -> Self
pub fn set_key_definition<T: Into<Option<KeyDefinition>>>(self, v: T) -> Self
Sets the value of key_definition.
Note that all the setters affecting key_definition are mutually
exclusive.
§Example
use google_cloud_pubsub::model::bigtable_config::column_family_mapping::RowKeySchema;
let x = ColumnFamilyMapping::new().set_key_definition(Some(
google_cloud_pubsub::model::bigtable_config::column_family_mapping::KeyDefinition::RowKeySchema(RowKeySchema::default().into())));Sourcepub fn row_key_schema(&self) -> Option<&Box<RowKeySchema>>
pub fn row_key_schema(&self) -> Option<&Box<RowKeySchema>>
The value of key_definition
if it holds a RowKeySchema, None if the field is not set or
holds a different branch.
Sourcepub fn set_row_key_schema<T: Into<Box<RowKeySchema>>>(self, v: T) -> Self
pub fn set_row_key_schema<T: Into<Box<RowKeySchema>>>(self, v: T) -> Self
Sets the value of key_definition
to hold a RowKeySchema.
Note that all the setters affecting key_definition are
mutually exclusive.
§Example
use google_cloud_pubsub::model::bigtable_config::column_family_mapping::RowKeySchema;
let x = ColumnFamilyMapping::new().set_row_key_schema(RowKeySchema::default()/* use setters */);
assert!(x.row_key_schema().is_some());
assert!(x.delimited_key().is_none());Sourcepub fn delimited_key(&self) -> Option<&Box<DelimitedKey>>
pub fn delimited_key(&self) -> Option<&Box<DelimitedKey>>
The value of key_definition
if it holds a DelimitedKey, None if the field is not set or
holds a different branch.
Sourcepub fn set_delimited_key<T: Into<Box<DelimitedKey>>>(self, v: T) -> Self
pub fn set_delimited_key<T: Into<Box<DelimitedKey>>>(self, v: T) -> Self
Sets the value of key_definition
to hold a DelimitedKey.
Note that all the setters affecting key_definition are
mutually exclusive.
§Example
use google_cloud_pubsub::model::bigtable_config::column_family_mapping::DelimitedKey;
let x = ColumnFamilyMapping::new().set_delimited_key(DelimitedKey::default()/* use setters */);
assert!(x.delimited_key().is_some());
assert!(x.row_key_schema().is_none());Trait Implementations§
Source§impl Clone for ColumnFamilyMapping
impl Clone for ColumnFamilyMapping
Source§impl Debug for ColumnFamilyMapping
impl Debug for ColumnFamilyMapping
Source§impl Default for ColumnFamilyMapping
impl Default for ColumnFamilyMapping
Source§impl Message for ColumnFamilyMapping
impl Message for ColumnFamilyMapping
Source§impl PartialEq for ColumnFamilyMapping
impl PartialEq for ColumnFamilyMapping
impl StructuralPartialEq for ColumnFamilyMapping
Auto Trait Implementations§
impl Freeze for ColumnFamilyMapping
impl RefUnwindSafe for ColumnFamilyMapping
impl Send for ColumnFamilyMapping
impl Sync for ColumnFamilyMapping
impl Unpin for ColumnFamilyMapping
impl UnsafeUnpin for ColumnFamilyMapping
impl UnwindSafe for ColumnFamilyMapping
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