Struct Xmp

Source
pub struct Xmp(/* private fields */);
Expand description

The XMP Packet

Implementations§

Source§

impl Xmp

Source

pub fn new() -> Xmp

New Xmp object

Source

pub fn from_buffer<T: AsRef<[u8]>>(buf: T) -> Result<Xmp>

New Xmp object a byte buffer. Return None if parsing failed.

Source

pub fn parse<T: AsRef<[u8]>>(&mut self, buf: T) -> Result<()>

Parse buff into a Xmp

Source

pub fn serialize(&self, options: SerialFlags, padding: u32) -> Result<XmpString>

Serialize the Xmp to an XmpString.

Source

pub fn serialize_and_format( &self, options: SerialFlags, padding: u32, newline: &str, tab: &str, indent: i32, ) -> Result<XmpString>

Serialize the Xmp to an XmpString with some formatting options.

Source

pub fn get_property( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<XmpString>

Get property as a XmpString.

Source

pub fn get_property_date( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<DateTime>

Get DateTime property.

Source

pub fn get_property_float( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<f64>

Get float property

Source

pub fn get_property_bool( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<bool>

Get bool property

Source

pub fn get_property_i32( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<i32>

Get i32 property

Source

pub fn get_property_i64( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<i64>

Get i64 property

Source

pub fn get_array_item( &self, schema: &str, name: &str, index: i32, propsbits: &mut PropFlags, ) -> Result<XmpString>

Get array item property

Source

pub fn set_property( &mut self, schema: &str, name: &str, value: &str, optionbits: PropFlags, ) -> Result<()>

Set a string property value

Source

pub fn set_property_date( &mut self, schema: &str, name: &str, value: &DateTime, optionbits: PropFlags, ) -> Result<()>

Set a date property value

Source

pub fn set_property_float( &mut self, schema: &str, name: &str, value: f64, optionbits: PropFlags, ) -> Result<()>

Set a float property value

Source

pub fn set_property_bool( &mut self, schema: &str, name: &str, value: bool, optionbits: PropFlags, ) -> Result<()>

Set a bool property value

Source

pub fn set_property_i32( &mut self, schema: &str, name: &str, value: i32, optionbits: PropFlags, ) -> Result<()>

Set an i32 property value

Source

pub fn set_property_i64( &mut self, schema: &str, name: &str, value: i64, optionbits: PropFlags, ) -> Result<()>

Set an i64 property value

Source

pub fn set_array_item( &mut self, schema: &str, name: &str, index: i32, value: &str, item_options: PropFlags, ) -> Result<()>

Set an array item

Source

pub fn append_array_item( &mut self, schema: &str, name: &str, array_options: PropFlags, value: &str, item_options: PropFlags, ) -> Result<()>

Append an array item.

Source

pub fn delete_property(&mut self, schema: &str, name: &str) -> Result<()>

Delete a property

Source

pub fn has_property(&self, schema: &str, name: &str) -> bool

Has a property

Source

pub fn get_localized_text( &self, schema: &str, name: &str, gen_lang: &str, spec_lang: &str, propsbits: &mut PropFlags, ) -> Result<(XmpString, XmpString)>

Get localized text.

Source

pub fn set_localized_text( &mut self, schema: &str, name: &str, gen_lang: &str, spec_lang: &str, value: &str, propbits: PropFlags, ) -> Result<()>

Set localized text.

Source

pub fn delete_localized_text( &mut self, schema: &str, name: &str, gen_lang: &str, spec_lang: &str, ) -> Result<()>

Delete localize text.

Source

pub fn is_null(&self) -> bool

Return if the native pointer is null.

Source

pub fn as_ptr(&self) -> *const Xmp

Return the native pointer.

Source

pub fn as_mut_ptr(&mut self) -> *mut Xmp

Return the mutable native pointer.

Trait Implementations§

Source§

impl Clone for Xmp

Source§

fn clone(&self) -> Self

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 Default for Xmp

Source§

fn default() -> Xmp

Return a valid but empty XMP packet.

Source§

impl Drop for Xmp

Source§

fn drop(&mut self)

Will release the Xmp native pointer on Drop.

Source§

impl From<*mut Xmp> for Xmp

Source§

fn from(ptr: *mut Xmp) -> Xmp

Construct from a native ptr. Will own it.

Source§

impl Send for Xmp

Auto Trait Implementations§

§

impl Freeze for Xmp

§

impl RefUnwindSafe for Xmp

§

impl !Sync for Xmp

§

impl Unpin for Xmp

§

impl UnwindSafe for Xmp

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> 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.