pub struct NCMFile { /* private fields */ }Expand description
A struct contains all the data parsed from the ncm file.
Implementations§
Source§impl NCMFile
impl NCMFile
Sourcepub fn get_music(&mut self) -> Result<&Vec<u8>, ParseError>
pub fn get_music(&mut self) -> Result<&Vec<u8>, ParseError>
Get music. Usually in MP3 or FLAC format. This function contains the decrypting precedure if calling the first time, and directly return the decrypted data after first-time calling.
Sourcepub fn get_image(&self) -> Result<&Vec<u8>, !>
pub fn get_image(&self) -> Result<&Vec<u8>, !>
Get cover image. Usually in PNG or JPEG format.
Same as get_image_unchecked().
Sourcepub fn get_metadata(&mut self) -> Result<&Vec<u8>, ParseError>
pub fn get_metadata(&mut self) -> Result<&Vec<u8>, ParseError>
Get metadata. This function contains the decrypting precedure if calling the first time, and directly return the decrypted data after first-time calling.
Sourcepub fn get_image_unchecked(&self) -> &Vec<u8> ⓘ
pub fn get_image_unchecked(&self) -> &Vec<u8> ⓘ
Directly get cover image. Usually in PNG or JPEG format.
Same as get_image().
Sourcepub fn get_music_unchecked(&self) -> &Vec<u8> ⓘ
pub fn get_music_unchecked(&self) -> &Vec<u8> ⓘ
Directly get music.
The music data is not decrypted if get_music() has never been called.
Sourcepub fn get_metadata_unchecked(&self) -> &Vec<u8> ⓘ
pub fn get_metadata_unchecked(&self) -> &Vec<u8> ⓘ
Directly get metadata.
The metadata is not decrypted if get_metadata() has never been called.
Sourcepub fn get_parsed_metadata(&mut self) -> Result<NCMMetadata, ParseError>
Available on crate feature serde_json only.
pub fn get_parsed_metadata(&mut self) -> Result<NCMMetadata, ParseError>
serde_json only.Parse the JSON format metadata into struct.