reword some doc comments

This commit is contained in:
Ashley Wulber 2024-02-28 15:06:21 -05:00
parent 7a72dd39f0
commit 84229d0503
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -34,7 +34,7 @@ pub enum MimeType {
///
/// Fallback without charset parameter.
TextPlain,
/// Other mime type
/// Other mime type.
Other(Cow<'static, str>),
}
@ -55,15 +55,16 @@ impl MimeType {
/// Describes the mime types which are accepted
pub trait AllowedMimeTypes: TryFrom<(Vec<u8>, MimeType)> {
/// List allowed mime types for the type to convert from a byte slice.
fn allowed() -> Cow<'static, [MimeType]>;
}
/// Can be converted to data with the available mime types
pub trait AsMimeTypes {
/// Available mime types for this data
/// List available mime types for this data to convert to a byte slice.
fn available(&self) -> Cow<'static, [MimeType]>;
/// Data as a specific mime_type
/// Converts a type to a byte slice for the given mime type if possible.
fn as_bytes(&self, mime_type: &MimeType) -> Option<Cow<'static, [u8]>>;
}