#[non_exhaustive]pub struct AnswerReference {
pub content: Option<Content>,
/* private fields */
}Expand description
Represents a reference to a source.
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.content: Option<Content>Contains the content of the reference.
Implementations§
Source§impl AnswerReference
impl AnswerReference
Sourcepub fn set_content<T: Into<Option<Content>>>(self, v: T) -> Self
pub fn set_content<T: Into<Option<Content>>>(self, v: T) -> Self
Sets the value of content.
Note that all the setters affecting content are mutually
exclusive.
§Example
ⓘ
use google_developers_knowledge_v1::model::answer::DocumentReference;
let x = AnswerReference::new().set_content(Some(
google_developers_knowledge_v1::model::answer::answer_reference::Content::DocumentReference(DocumentReference::default().into())));Sourcepub fn document_reference(&self) -> Option<&Box<DocumentReference>>
pub fn document_reference(&self) -> Option<&Box<DocumentReference>>
The value of content
if it holds a DocumentReference, None if the field is not set or
holds a different branch.
Sourcepub fn set_document_reference<T: Into<Box<DocumentReference>>>(
self,
v: T,
) -> Self
pub fn set_document_reference<T: Into<Box<DocumentReference>>>( self, v: T, ) -> Self
Sets the value of content
to hold a DocumentReference.
Note that all the setters affecting content are
mutually exclusive.
§Example
ⓘ
use google_developers_knowledge_v1::model::answer::DocumentReference;
let x = AnswerReference::new().set_document_reference(DocumentReference::default()/* use setters */);
assert!(x.document_reference().is_some());Trait Implementations§
Source§impl Clone for AnswerReference
impl Clone for AnswerReference
Source§fn clone(&self) -> AnswerReference
fn clone(&self) -> AnswerReference
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnswerReference
impl Debug for AnswerReference
Source§impl Default for AnswerReference
impl Default for AnswerReference
Source§fn default() -> AnswerReference
fn default() -> AnswerReference
Returns the “default value” for a type. Read more
Source§impl Message for AnswerReference
impl Message for AnswerReference
Source§impl PartialEq for AnswerReference
impl PartialEq for AnswerReference
impl StructuralPartialEq for AnswerReference
Auto Trait Implementations§
impl Freeze for AnswerReference
impl RefUnwindSafe for AnswerReference
impl Send for AnswerReference
impl Sync for AnswerReference
impl Unpin for AnswerReference
impl UnsafeUnpin for AnswerReference
impl UnwindSafe for AnswerReference
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