pub struct OwnershipFrame<'a> {
pub encoding: TextEncoding,
pub price_paid: String,
pub date_of_purchase: String,
pub seller: String,
/* private fields */
}Expand description
An ID3v2 ownership frame
This is used to mark a transaction, and is recommended to be used in addition to the USER and TOWN frames.
Fields§
§encoding: TextEncodingThe encoding of the seller string
price_paid: StringThe price paid
The first three characters of this field contains the currency used for the transaction, encoded according to ISO 4217 alphabetic currency code. Concatenated to this is the actual price paid, as a numerical string using ”.” as the decimal separator.
date_of_purchase: StringThe date of purchase as an 8 character date string (YYYYMMDD)
seller: StringThe seller name
Implementations§
Source§impl OwnershipFrame<'_>
impl OwnershipFrame<'_>
Sourcepub fn new(
encoding: TextEncoding,
price_paid: String,
date_of_purchase: String,
seller: String,
) -> Self
pub fn new( encoding: TextEncoding, price_paid: String, date_of_purchase: String, seller: String, ) -> Self
Create a new OwnershipFrame
Sourcepub fn flags(&self) -> FrameFlags
pub fn flags(&self) -> FrameFlags
Get the flags for the frame
Sourcepub fn set_flags(&mut self, flags: FrameFlags)
pub fn set_flags(&mut self, flags: FrameFlags)
Set the flags for the frame
Sourcepub fn parse<R>(reader: &mut R, frame_flags: FrameFlags) -> Result<Option<Self>>where
R: Read,
pub fn parse<R>(reader: &mut R, frame_flags: FrameFlags) -> Result<Option<Self>>where
R: Read,
Read an OwnershipFrame
NOTE: This expects the frame header to have already been skipped
§Errors
- Invalid text encoding
- Not enough data
Trait Implementations§
Source§impl<'a> Clone for OwnershipFrame<'a>
impl<'a> Clone for OwnershipFrame<'a>
Source§fn clone(&self) -> OwnershipFrame<'a>
fn clone(&self) -> OwnershipFrame<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for OwnershipFrame<'a>
impl<'a> Debug for OwnershipFrame<'a>
Source§impl<'a> From<OwnershipFrame<'a>> for Frame<'a>
impl<'a> From<OwnershipFrame<'a>> for Frame<'a>
Source§fn from(value: OwnershipFrame<'a>) -> Self
fn from(value: OwnershipFrame<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> Hash for OwnershipFrame<'a>
impl<'a> Hash for OwnershipFrame<'a>
Source§impl<'a> PartialEq for OwnershipFrame<'a>
impl<'a> PartialEq for OwnershipFrame<'a>
impl<'a> Eq for OwnershipFrame<'a>
impl<'a> StructuralPartialEq for OwnershipFrame<'a>
Auto Trait Implementations§
impl<'a> Freeze for OwnershipFrame<'a>
impl<'a> RefUnwindSafe for OwnershipFrame<'a>
impl<'a> Send for OwnershipFrame<'a>
impl<'a> Sync for OwnershipFrame<'a>
impl<'a> Unpin for OwnershipFrame<'a>
impl<'a> UnwindSafe for OwnershipFrame<'a>
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