Implement the body of Value::display_as().
This commit is contained in:
parent
7c61ddf3f9
commit
5a540228c3
1002
src/tag.rs
1002
src/tag.rs
File diff suppressed because it is too large
Load Diff
12
src/value.rs
12
src/value.rs
|
@ -72,6 +72,18 @@ impl<'a> Value<'a> {
|
||||||
/// Returns an object that implements `std::fmt::Display` for
|
/// Returns an object that implements `std::fmt::Display` for
|
||||||
/// printing a value in a tag-specific format.
|
/// printing a value in a tag-specific format.
|
||||||
/// The tag of the value is specified as the argument.
|
/// The tag of the value is specified as the argument.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use exif::{Value, tag};
|
||||||
|
/// let val = Value::Undefined(b"0231");
|
||||||
|
/// assert_eq!(format!("{}", val.display_as(tag::ExifVersion)),
|
||||||
|
/// "2.31");
|
||||||
|
/// let val = Value::Short(vec![2]);
|
||||||
|
/// assert_eq!(format!("{}", val.display_as(tag::ResolutionUnit)),
|
||||||
|
/// "pixels per inch");
|
||||||
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn display_as(&self, tag: ::tag_priv::Tag) -> Display {
|
pub fn display_as(&self, tag: ::tag_priv::Tag) -> Display {
|
||||||
::tag_priv::display_value_as(self, tag)
|
::tag_priv::display_value_as(self, tag)
|
||||||
|
|
Loading…
Reference in New Issue