pub fn write_to_path(&self, path: impl AsRef<Path>, version: Version) -> crate::Result<()> {
        let mut file = fs::OpenOptions::new().read(true).write(true).open(path)?;
        #[allow(clippy::reversed_empty_ranges)]
        let location = stream::tag::locate_id3v2(&mut file)?.unwrap_or(0..0); // Create a new tag if none could be located.

        let mut storage = PlainStorage::new(file, location);
        let mut w = storage.writer()?;
        stream::tag::Encoder::new()
            .version(version)
            .encode(self, &mut w)?;
        w.flush()?;
        Ok(())
    }
/// Attempts to write the ID3 tag from the file at the indicated path. If the specified path is
/// the same path which the tag was read from, then the tag will be written to the padding if
/// possible.
Attempts to write the ID3 tag from the file at the indicated path. If the specified path is
the same path which the tag was read from, then the tag will be written to the padding if
possible.
Attempts to write the ID3 tag from the file at the indicated path . If the specified path is the same path which the tag was read from then the tag will be written to the padding if possible .
pub fn write_to_path(&self, path: impl AsRef<Path>, version: Version) -> crate::Result<()> {
        let mut file = fs::OpenOptions::new().read(true).write(true).open(path)?;
        #[allow(clippy::reversed_empty_ranges)]
        let location = stream::tag::locate_id3v2(&mut file)?.unwrap_or(0..0); // Create a new tag if none could be located.
        let mut storage = PlainStorage::new(file, location);
        let mut w = storage.writer()?;
        stream::tag::Encoder::new()
            .version(version)
            .encode(self, &mut w)?;
        w.flush()?;
        Ok(())
    }
pub fn write_to_path ( & self , path : impl AsRef < Path > , version : Version ) -> crate :: Result < ( ) > { let mut file = fs :: OpenOptions :: new ( ) . read ( true ) . write ( true ) . open ( path ) ? ; # [ allow ( clippy reversed_empty_ranges ) ] let location = stream :: tag :: locate_id3v2 ( & mut file ) ? . unwrap_or ( 0 .. 0 ) ; // Create a new tag if none could be located. let mut storage = PlainStorage :: new ( file , location ) ; let mut w = storage . writer ( ) ? ; stream :: tag :: Encoder :: new ( ) . version ( version ) . encode ( self , & mut w ) ? ; w . flush ( ) ? ; Ok ( ( ) ) }
Attempts to write the ID3 tag from the file at the indicated path.
Attempts to write the ID3 tag from the file at the indicated path .
&self
path
impl AsRef<Path>
version
Version
&self
path
impl AsRef<Path>
version
Version