fn add_frame(&mut self, new_frame: impl Into<Frame>) -> Option<Frame> {
        let new_frame = new_frame.into();
        let removed = self
            .frames_vec()
            .iter()
            .position(|frame| frame.unique() == new_frame.unique())
            .map(|conflict_index| self.frames_vec_mut().remove(conflict_index));
        self.frames_vec_mut().push(new_frame);
        removed
    }
/// Adds the frame to the tag, replacing and returning any conflicting frame.
///
/// # Example
/// ```
/// use id3::{Tag, TagLike, Frame, Content};
/// use id3::frame::ExtendedText;
///
/// fn main() -> Result<(), Box<dyn std::error::Error>> {
///     let mut tag = Tag::new();
///
///     tag.add_frame(Frame::text("TPE1", "Armin van Buuren"));
///     tag.add_frame(ExtendedText{
///         description: "hello".to_string(),
///         value: "world".to_string(),
///     });
///
///     let removed = tag.add_frame(Frame::text("TPE1", "John 00 Fleming"))
///         .ok_or("no such frame")?;
///     assert_eq!(removed.content().text(), Some("Armin van Buuren"));
///     Ok(())
/// }
/// ```
Adds the frame to the tag, replacing and returning any conflicting frame.
Adds the frame to the tag replacing and returning any conflicting frame .
fn add_frame(&mut self, new_frame: impl Into<Frame>) -> Option<Frame> {
        let new_frame = new_frame.into();
        let removed = self
            .frames_vec()
            .iter()
            .position(|frame| frame.unique() == new_frame.unique())
            .map(|conflict_index| self.frames_vec_mut().remove(conflict_index));
        self.frames_vec_mut().push(new_frame);
        removed
    }
fn add_frame ( & mut self , new_frame : impl Into < Frame > ) -> Option < Frame > { let new_frame = new_frame . into ( ) ; let removed = self . frames_vec ( ) . iter ( ) . position ( | frame | frame . unique ( ) == new_frame . unique ( ) ) . map ( | conflict_index | self . frames_vec_mut ( ) . remove ( conflict_index ) ) ; self . frames_vec_mut ( ) . push ( new_frame ) ; removed }
Adds the frame to the tag, replacing and returning any conflicting frame.
Adds the frame to the tag replacing and returning any conflicting frame .
&mut self
new_frame
impl Into<Frame>
&mut self
new_frame
impl Into<Frame>
example
```
use id3::{Tag, TagLike, Frame, Content};
use id3::frame::ExtendedText.

fn main() -> Result<(), Box> {
let mut tag = Tag::new().

tag.add_frame(Frame::text("TPE1", "Armin van Buuren"));
tag.add_frame(ExtendedText{
description: "hello".to_string(),
value: "world".to_string(),
}).

let removed = tag.add_frame(Frame::text("TPE1", "John 00 Fleming"))
.ok_or("no such frame")?;
assert_eq!(removed.content().text(), Some("Armin van Buuren"));
Ok(())
}
```
` ` ` use id3 :: { Tag TagLike Frame Content } ; use id3 :: frame :: ExtendedText . fn main () - > Result< () Box > { let mut tag = Tag :: new () . tag . add_frame ( Frame :: text ( " TPE1 " " Armin van Buuren " )) ; tag . add_frame ( ExtendedText { description : " hello " . to_string () value : " world " . to_string () } ) . let removed = tag . add_frame ( Frame :: text ( " TPE1 " " John 00 Fleming " )) . ok_or ( " no such frame " ) ? ; assert_eq! ( removed . content () . text () Some ( " Armin van Buuren " )) ; Ok (( )) } ` ` `