pub enum ParamSource<'a> {
Text(&'a str),
Binary(&'a [u8]),
File(&'a Path),
Reader(&'a DataReader),
}Expand description
Where a network reads its parameters from.
A text or binary source keeps the parameters in memory, a file source lets the native stdio loader read the path, and a reader source serves an archive or an embedded asset.
Variants§
Text(&'a str)
Text parameters, starting with the 7767517 magic line.
Binary(&'a [u8])
Parameters in the binary form ncnn2mem writes, which needs no text parsing.
File(&'a Path)
A file the native stdio loader opens.
Reader(&'a DataReader)
A reader that owns its bytes or file.
Trait Implementations§
Source§impl<'a> From<&'a DataReader> for ParamSource<'a>
impl<'a> From<&'a DataReader> for ParamSource<'a>
Source§fn from(reader: &'a DataReader) -> Self
fn from(reader: &'a DataReader) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a Path> for ParamSource<'a>
impl<'a> From<&'a Path> for ParamSource<'a>
Source§impl<'a> From<&'a PathBuf> for ParamSource<'a>
impl<'a> From<&'a PathBuf> for ParamSource<'a>
Source§impl<'a> From<&'a [u8]> for ParamSource<'a>
impl<'a> From<&'a [u8]> for ParamSource<'a>
Auto Trait Implementations§
impl<'a> !Send for ParamSource<'a>
impl<'a> !Sync for ParamSource<'a>
impl<'a> Freeze for ParamSource<'a>
impl<'a> RefUnwindSafe for ParamSource<'a>
impl<'a> Unpin for ParamSource<'a>
impl<'a> UnsafeUnpin for ParamSource<'a>
impl<'a> UnwindSafe for ParamSource<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more