#[non_exhaustive]pub struct Image {
pub content: Bytes,
pub source: Option<ImageSource>,
/* private fields */
}Expand description
Client image to perform Google Cloud Vision API tasks over.
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: BytesImage content, represented as a stream of bytes.
Note: As with all bytes fields, protobuffers use a pure binary
representation, whereas JSON representations use base64.
Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests.
source: Option<ImageSource>Google Cloud Storage image location, or publicly-accessible image
URL. If both content and source are provided for an image, content
takes precedence and is used to perform the image annotation request.
Implementations§
Source§impl Image
impl Image
pub fn new() -> Self
Sourcepub fn set_content<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_content<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of content.
Sourcepub fn set_source<T>(self, v: T) -> Selfwhere
T: Into<ImageSource>,
pub fn set_source<T>(self, v: T) -> Selfwhere
T: Into<ImageSource>,
Sets the value of source.
Sourcepub fn set_or_clear_source<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImageSource>,
pub fn set_or_clear_source<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImageSource>,
Sets or clears the value of source.
Trait Implementations§
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl !Freeze for Image
impl RefUnwindSafe for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnwindSafe for Image
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