Struct Image

Source
pub struct Image { /* private fields */ }

Implementations§

Source§

impl Image

§Example
extern crate umya_spreadsheet;
let mut book = umya_spreadsheet::new_file();

// Add Image
let mut marker = umya_spreadsheet::structs::drawing::spreadsheet::MarkerType::default();
marker.set_coordinate("B3");
let mut image = umya_spreadsheet::structs::Image::default();
image.new_image("./images/sample1.png", marker);
book.get_sheet_by_name_mut("Sheet1").unwrap()
    .add_image(image);

// Get Image by Worksheet.
let worksheet = book.get_sheet_by_name_mut("Sheet1").unwrap();
let image = worksheet.get_image("B3");
let image = worksheet.get_image_by_column_and_row(&2, &1);
let image = worksheet.get_image_mut("B3");
let image = worksheet.get_image_by_column_and_row_mut(&2, &1);

// Use this if there are multiple Images in a given cell.
let images = worksheet.get_images("B3");
let images = worksheet.get_images_by_column_and_row(&2, &1);
let images = worksheet.get_images_mut("B3");
let images = worksheet.get_images_by_column_and_row_mut(&2, &1);

// Download Image
book.get_sheet_by_name("Sheet1").unwrap()
.get_image_collection()
.get(0)
.unwrap()
.download_image("./tests/result_files/bbb.png");

// Change Image
book.get_sheet_by_name_mut("Sheet1").unwrap()
.get_image_collection_mut()
.get_mut(0)
.unwrap()
.change_image("./images/sample1.png");
Source

pub fn get_two_cell_anchor(&self) -> Option<&TwoCellAnchor>

Source

pub fn get_two_cell_anchor_mut(&mut self) -> Option<&mut TwoCellAnchor>

Source

pub fn set_two_cell_anchor(&mut self, value: TwoCellAnchor) -> &mut Self

Source

pub fn remove_two_cell_anchor(&mut self) -> &mut Self

Source

pub fn get_one_cell_anchor(&self) -> Option<&OneCellAnchor>

Source

pub fn get_one_cell_anchor_mut(&mut self) -> Option<&mut OneCellAnchor>

Source

pub fn set_one_cell_anchor(&mut self, value: OneCellAnchor) -> &mut Self

Source

pub fn remove_one_cell_anchor(&mut self) -> &mut Self

Source

pub fn new_image(&mut self, path: &str, marker: MarkerType)

Source

pub fn new_image_with_dimensions<B: Into<Vec<u8>>>( &mut self, height: u32, width: u32, image_name: &str, bytes: B, marker: MarkerType, )

Source

pub fn change_image(&mut self, path: &str)

Source

pub fn download_image(&self, path: &str)

Source

pub fn has_image(&self) -> bool

Source

pub fn get_image_name(&self) -> &str

Source

pub fn get_image_data(&self) -> &[u8]

Source

pub fn get_image_data_base64(&self) -> String

Source

pub fn get_coordinate(&self) -> String

Source

pub fn get_col(&self) -> &u32

Source

pub fn get_row(&self) -> &u32

Source

pub fn get_from_marker_type(&self) -> &MarkerType

Source

pub fn get_to_marker_type(&self) -> Option<&MarkerType>

Trait Implementations§

Source§

impl Clone for Image

Source§

fn clone(&self) -> Image

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Image

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Image

Source§

fn default() -> Image

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.