pub struct ContentDirectoryProvider {
pub name: Option<String>,
pub directory: Option<ClientEnd<DirectoryMarker>>,
/* private fields */
}
Expand description
Defines a provider which hosts resources from a [fuchsia.io/Directory
]. Content can GET
resource files via the provider, but not enumerate directories. Resources can be accessed by
their URLs: fuchsia-dir://<provider-name>/<path/to/resource>
By default the MIME types of files are determined automatically by “sniffing” the contents of
the files. No content encoding will be declared, which browsers will interpret as meaning
"text/plain"
.
Content type and encoding metadata may optionally be specified explicitly by metadata files,
which reside alongside the file. Metadata is expressed in JSON files, named after the files
they describe with a "._metadata"
suffix.
For example, the file "index.html"
would have the a metadata file called
"index.html._metadata"
, with the following contents:
{
"charset": "utf-8",
"mime": "text/html"
}
Fields§
§name: Option<String>
Name of the provider. Must be non-empty and composed solely of alphanumerics, dots, and dashes.
directory: Option<ClientEnd<DirectoryMarker>>
Directory containing the files served by this provider.
Trait Implementations§
Source§impl Debug for ContentDirectoryProvider
impl Debug for ContentDirectoryProvider
Source§impl Decode<ContentDirectoryProvider, DefaultFuchsiaResourceDialect> for ContentDirectoryProvider
impl Decode<ContentDirectoryProvider, DefaultFuchsiaResourceDialect> for ContentDirectoryProvider
Source§impl Default for ContentDirectoryProvider
impl Default for ContentDirectoryProvider
Source§fn default() -> ContentDirectoryProvider
fn default() -> ContentDirectoryProvider
Source§impl Encode<ContentDirectoryProvider, DefaultFuchsiaResourceDialect> for &mut ContentDirectoryProvider
impl Encode<ContentDirectoryProvider, DefaultFuchsiaResourceDialect> for &mut ContentDirectoryProvider
Source§impl PartialEq for ContentDirectoryProvider
impl PartialEq for ContentDirectoryProvider
Source§impl ResourceTypeMarker for ContentDirectoryProvider
impl ResourceTypeMarker for ContentDirectoryProvider
Source§type Borrowed<'a> = &'a mut ContentDirectoryProvider
type Borrowed<'a> = &'a mut ContentDirectoryProvider
Encode<Self>
type cheaply obtainable from &mut Self::Owned
. There are three cases: Read moreSource§fn take_or_borrow<'a>(
value: &'a mut <Self as TypeMarker>::Owned,
) -> Self::Borrowed<'a>
fn take_or_borrow<'a>( value: &'a mut <Self as TypeMarker>::Owned, ) -> Self::Borrowed<'a>
&mut Self::Owned
to Self::Borrowed
. For
HandleBased
types this is “take” (it returns an owned handle and
replaces value
with Handle::invalid
), and for all other types it is
“borrow” (just converts from one reference to another).Source§impl TypeMarker for ContentDirectoryProvider
impl TypeMarker for ContentDirectoryProvider
Source§type Owned = ContentDirectoryProvider
type Owned = ContentDirectoryProvider
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.