use ;
use Write;
pub use Family;
pub use Error;
/// Serializes `value` into a [`String`].
///
/// See [`serializer`] for information about the data format.
///
/// #### Examples
///
/// Basic usage:
///
/// ```rust
/// # use serde::Serialize;
/// # use serde_prometheus_labels::to_string;
/// #
/// #[derive(Serialize)]
/// struct Labels {
/// method: Method,
/// path: String,
/// }
///
/// #[derive(Serialize)]
/// enum Method {
/// #[serde(rename = "GET")]
/// Get,
/// }
///
/// let labels = Labels {
/// method: Method::Get,
/// path: "/metrics".to_string(),
/// };
///
/// let serialized = to_string(&labels).unwrap();
///
/// assert_eq!(serialized, r#"method="GET",path="/metrics""#);
/// ```
///
/// Optional values:
///
/// ```rust
/// # use serde::Serialize;
/// # use serde_prometheus_labels::to_string;
/// #
/// #[derive(Serialize)]
/// struct Error {
/// severity: Option<&'static str>,
/// reason: Option<&'static str>,
/// }
///
/// let error = Error {
/// severity: Some("fatal"),
/// reason: None,
/// };
///
/// let serialized = to_string(&error).unwrap();
///
/// assert_eq!(serialized, r#"severity="fatal",reason="""#);
/// ```
/// Serializes `value` into a [`Vec<u8>`].
///
/// See [`serializer`] for information about the data format.
///
/// #### Examples
///
/// Basic usage:
///
/// ```rust
/// # use serde::Serialize;
/// # use serde_prometheus_labels::to_vec;
/// #
/// #[derive(Serialize)]
/// struct Labels {
/// method: Method,
/// path: String,
/// }
///
/// #[derive(Serialize)]
/// enum Method {
/// #[serde(rename = "GET")]
/// Get,
/// }
///
/// let labels = Labels {
/// method: Method::Get,
/// path: "/metrics".to_string(),
/// };
///
/// let serialized = to_vec(&labels).unwrap();
///
/// assert_eq!(serialized, br#"method="GET",path="/metrics""#);
/// ```
/// Serializes `value` into [`writer`][Write].
///
/// See [`serializer`] for information about the data format.
/// A serializer for Prometheus labels.
///
/// This serializer only supports structs.
///
/// For struct fields, the supported values are scalars, strings, and bytes
/// that can be converted to strings. Nones and units are ignored, and unit
/// variants are serialized as their name. Anything else results in an error.
///
/// Prometheus labels are a sequence of comma-separated key-value pairs
/// as specified by the [Prometheus documentation][doc].
///
/// [doc]: https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-format-details
'_ +