mirror of
https://github.com/sile/hls_m3u8.git
synced 2025-01-10 20:25:25 +00:00
improve documentation of ExtXVersion
This commit is contained in:
parent
5304947885
commit
8948f9914b
1 changed files with 3 additions and 35 deletions
|
@ -5,44 +5,12 @@ use crate::types::ProtocolVersion;
|
||||||
use crate::utils::tag;
|
use crate::utils::tag;
|
||||||
use crate::{Error, RequiredVersion};
|
use crate::{Error, RequiredVersion};
|
||||||
|
|
||||||
/// # [4.3.1.2. EXT-X-VERSION]
|
/// The compatibility version of a playlist.
|
||||||
///
|
///
|
||||||
/// The [`ExtXVersion`] tag indicates the compatibility version of the
|
/// It applies to the entire [`MasterPlaylist`] or [`MediaPlaylist`].
|
||||||
/// [`MasterPlaylist`] or [`MediaPlaylist`] file.
|
|
||||||
/// It applies to the entire Playlist.
|
|
||||||
///
|
|
||||||
/// # Examples
|
|
||||||
///
|
|
||||||
/// Parsing from a [`str`]:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// # use hls_m3u8::tags::ExtXVersion;
|
|
||||||
/// #
|
|
||||||
/// use hls_m3u8::types::ProtocolVersion;
|
|
||||||
///
|
|
||||||
/// assert_eq!(
|
|
||||||
/// "#EXT-X-VERSION:5".parse::<ExtXVersion>()?,
|
|
||||||
/// ExtXVersion::new(ProtocolVersion::V5)
|
|
||||||
/// );
|
|
||||||
/// # Ok::<(), Box<dyn ::std::error::Error>>(())
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// Converting to a [`str`]:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// # use hls_m3u8::tags::ExtXVersion;
|
|
||||||
/// #
|
|
||||||
/// use hls_m3u8::types::ProtocolVersion;
|
|
||||||
///
|
|
||||||
/// assert_eq!(
|
|
||||||
/// "#EXT-X-VERSION:5".to_string(),
|
|
||||||
/// ExtXVersion::new(ProtocolVersion::V5).to_string()
|
|
||||||
/// );
|
|
||||||
/// ```
|
|
||||||
///
|
///
|
||||||
/// [`MediaPlaylist`]: crate::MediaPlaylist
|
/// [`MediaPlaylist`]: crate::MediaPlaylist
|
||||||
/// [`MasterPlaylist`]: crate::MasterPlaylist
|
/// [`MasterPlaylist`]: crate::MasterPlaylist
|
||||||
/// [4.3.1.2. EXT-X-VERSION]: https://tools.ietf.org/html/rfc8216#section-4.3.1.2
|
|
||||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
|
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
|
||||||
pub struct ExtXVersion(ProtocolVersion);
|
pub struct ExtXVersion(ProtocolVersion);
|
||||||
|
|
||||||
|
@ -61,7 +29,7 @@ impl ExtXVersion {
|
||||||
/// ```
|
/// ```
|
||||||
pub const fn new(version: ProtocolVersion) -> Self { Self(version) }
|
pub const fn new(version: ProtocolVersion) -> Self { Self(version) }
|
||||||
|
|
||||||
/// Returns the [`ProtocolVersion`] of the playlist, containing this tag.
|
/// Returns the underlying [`ProtocolVersion`].
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue