#[non_exhaustive]pub struct Literal {
pub relative_path: String,
pub literal_data: Option<LiteralData>,
/* private fields */
}Expand description
Literal data.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.relative_path: StringRequired. The identifier of the literal entry.
literal_data: Option<LiteralData>The literal SQL contents.
Implementations§
Source§impl Literal
impl Literal
pub fn new() -> Self
Sourcepub fn set_relative_path<T: Into<String>>(self, v: T) -> Self
pub fn set_relative_path<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_literal_data<T: Into<Option<LiteralData>>>(self, v: T) -> Self
pub fn set_literal_data<T: Into<Option<LiteralData>>>(self, v: T) -> Self
Sets the value of literal_data.
Note that all the setters affecting literal_data are mutually
exclusive.
§Example
ⓘ
use google_cloud_bigquery_migration_v2::model::literal::LiteralData;
let x = Literal::new().set_literal_data(Some(LiteralData::LiteralString("example".to_string())));Sourcepub fn literal_string(&self) -> Option<&String>
pub fn literal_string(&self) -> Option<&String>
The value of literal_data
if it holds a LiteralString, None if the field is not set or
holds a different branch.
Sourcepub fn set_literal_string<T: Into<String>>(self, v: T) -> Self
pub fn set_literal_string<T: Into<String>>(self, v: T) -> Self
Sets the value of literal_data
to hold a LiteralString.
Note that all the setters affecting literal_data are
mutually exclusive.
§Example
ⓘ
let x = Literal::new().set_literal_string("example");
assert!(x.literal_string().is_some());
assert!(x.literal_bytes().is_none());Sourcepub fn literal_bytes(&self) -> Option<&Bytes>
pub fn literal_bytes(&self) -> Option<&Bytes>
The value of literal_data
if it holds a LiteralBytes, None if the field is not set or
holds a different branch.
Sourcepub fn set_literal_bytes<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_literal_bytes<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of literal_data
to hold a LiteralBytes.
Note that all the setters affecting literal_data are
mutually exclusive.
§Example
ⓘ
let x = Literal::new().set_literal_bytes(bytes::Bytes::from_static(b"example"));
assert!(x.literal_bytes().is_some());
assert!(x.literal_string().is_none());Trait Implementations§
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl !Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
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
Mutably borrows from an owned value. Read more