pub struct Document {
pub type: i32,
pub language: String,
pub reference_web_uri: String,
pub boilerplate_handling: i32,
pub source: Option<Source>,
}
Expand description
Represents the input to API methods.
Fields§
§type: i32
Required. If the type is not set or is TYPE_UNSPECIFIED
,
returns an INVALID_ARGUMENT
error.
language: String
The language of the document (if not specified, the language is
automatically detected). Both ISO and BCP-47 language codes are
accepted.
Language
Support lists
currently supported languages for each API method. If the language (either
specified by the caller or automatically detected) is not supported by the
called API method, an INVALID_ARGUMENT
error is returned.
reference_web_uri: String
The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.
boilerplate_handling: i32
Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.
source: Option<Source>
The source of the document: a string containing the content or a Google Cloud Storage URI.
Implementations§
source§impl Document
impl Document
sourcepub fn type(&self) -> Type
pub fn type(&self) -> Type
Returns the enum value of type
, or the default if the field is set to an invalid enum value.
sourcepub fn boilerplate_handling(&self) -> BoilerplateHandling
pub fn boilerplate_handling(&self) -> BoilerplateHandling
Returns the enum value of boilerplate_handling
, or the default if the field is set to an invalid enum value.
sourcepub fn set_boilerplate_handling(&mut self, value: BoilerplateHandling)
pub fn set_boilerplate_handling(&mut self, value: BoilerplateHandling)
Sets boilerplate_handling
to the provided enum value.
Trait Implementations§
source§impl Message for Document
impl Message for Document
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Document
impl PartialEq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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