pub struct Xmp(/* private fields */);
Expand description
The XMP Packet
Implementations§
Source§impl Xmp
impl Xmp
Sourcepub fn from_buffer<T: AsRef<[u8]>>(buf: T) -> Result<Xmp>
pub fn from_buffer<T: AsRef<[u8]>>(buf: T) -> Result<Xmp>
New Xmp object a byte buffer. Return None if parsing failed.
Sourcepub fn serialize(&self, options: SerialFlags, padding: u32) -> Result<XmpString>
pub fn serialize(&self, options: SerialFlags, padding: u32) -> Result<XmpString>
Serialize the Xmp to an XmpString.
Sourcepub fn serialize_and_format(
&self,
options: SerialFlags,
padding: u32,
newline: &str,
tab: &str,
indent: i32,
) -> Result<XmpString>
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.
Sourcepub fn get_property(
&self,
schema: &str,
name: &str,
propsbits: &mut PropFlags,
) -> Result<XmpString>
pub fn get_property( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<XmpString>
Get property as a XmpString.
Sourcepub fn get_property_date(
&self,
schema: &str,
name: &str,
propsbits: &mut PropFlags,
) -> Result<DateTime>
pub fn get_property_date( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<DateTime>
Get DateTime property.
Sourcepub fn get_property_float(
&self,
schema: &str,
name: &str,
propsbits: &mut PropFlags,
) -> Result<f64>
pub fn get_property_float( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<f64>
Get float property
Sourcepub fn get_property_bool(
&self,
schema: &str,
name: &str,
propsbits: &mut PropFlags,
) -> Result<bool>
pub fn get_property_bool( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<bool>
Get bool property
Sourcepub fn get_property_i32(
&self,
schema: &str,
name: &str,
propsbits: &mut PropFlags,
) -> Result<i32>
pub fn get_property_i32( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<i32>
Get i32 property
Sourcepub fn get_property_i64(
&self,
schema: &str,
name: &str,
propsbits: &mut PropFlags,
) -> Result<i64>
pub fn get_property_i64( &self, schema: &str, name: &str, propsbits: &mut PropFlags, ) -> Result<i64>
Get i64 property
Sourcepub fn get_array_item(
&self,
schema: &str,
name: &str,
index: i32,
propsbits: &mut PropFlags,
) -> Result<XmpString>
pub fn get_array_item( &self, schema: &str, name: &str, index: i32, propsbits: &mut PropFlags, ) -> Result<XmpString>
Get array item property
Sourcepub fn set_property(
&mut self,
schema: &str,
name: &str,
value: &str,
optionbits: PropFlags,
) -> Result<()>
pub fn set_property( &mut self, schema: &str, name: &str, value: &str, optionbits: PropFlags, ) -> Result<()>
Set a string property value
Sourcepub fn set_property_date(
&mut self,
schema: &str,
name: &str,
value: &DateTime,
optionbits: PropFlags,
) -> Result<()>
pub fn set_property_date( &mut self, schema: &str, name: &str, value: &DateTime, optionbits: PropFlags, ) -> Result<()>
Set a date property value
Sourcepub fn set_property_float(
&mut self,
schema: &str,
name: &str,
value: f64,
optionbits: PropFlags,
) -> Result<()>
pub fn set_property_float( &mut self, schema: &str, name: &str, value: f64, optionbits: PropFlags, ) -> Result<()>
Set a float property value
Sourcepub fn set_property_bool(
&mut self,
schema: &str,
name: &str,
value: bool,
optionbits: PropFlags,
) -> Result<()>
pub fn set_property_bool( &mut self, schema: &str, name: &str, value: bool, optionbits: PropFlags, ) -> Result<()>
Set a bool property value
Sourcepub fn set_property_i32(
&mut self,
schema: &str,
name: &str,
value: i32,
optionbits: PropFlags,
) -> Result<()>
pub fn set_property_i32( &mut self, schema: &str, name: &str, value: i32, optionbits: PropFlags, ) -> Result<()>
Set an i32 property value
Sourcepub fn set_property_i64(
&mut self,
schema: &str,
name: &str,
value: i64,
optionbits: PropFlags,
) -> Result<()>
pub fn set_property_i64( &mut self, schema: &str, name: &str, value: i64, optionbits: PropFlags, ) -> Result<()>
Set an i64 property value
Sourcepub fn set_array_item(
&mut self,
schema: &str,
name: &str,
index: i32,
value: &str,
item_options: PropFlags,
) -> Result<()>
pub fn set_array_item( &mut self, schema: &str, name: &str, index: i32, value: &str, item_options: PropFlags, ) -> Result<()>
Set an array item
Sourcepub fn append_array_item(
&mut self,
schema: &str,
name: &str,
array_options: PropFlags,
value: &str,
item_options: PropFlags,
) -> Result<()>
pub fn append_array_item( &mut self, schema: &str, name: &str, array_options: PropFlags, value: &str, item_options: PropFlags, ) -> Result<()>
Append an array item.
Sourcepub fn has_property(&self, schema: &str, name: &str) -> bool
pub fn has_property(&self, schema: &str, name: &str) -> bool
Has a property
Sourcepub fn get_localized_text(
&self,
schema: &str,
name: &str,
gen_lang: &str,
spec_lang: &str,
propsbits: &mut PropFlags,
) -> Result<(XmpString, XmpString)>
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.
Sourcepub fn set_localized_text(
&mut self,
schema: &str,
name: &str,
gen_lang: &str,
spec_lang: &str,
value: &str,
propbits: PropFlags,
) -> Result<()>
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.
Sourcepub fn delete_localized_text(
&mut self,
schema: &str,
name: &str,
gen_lang: &str,
spec_lang: &str,
) -> Result<()>
pub fn delete_localized_text( &mut self, schema: &str, name: &str, gen_lang: &str, spec_lang: &str, ) -> Result<()>
Delete localize text.
Sourcepub fn as_mut_ptr(&mut self) -> *mut Xmp
pub fn as_mut_ptr(&mut self) -> *mut Xmp
Return the mutable native pointer.
Trait Implementations§
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> 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