Struct keeshond_datapack::source::FilesystemSource[][src]

pub struct FilesystemSource { /* fields omitted */ }
Expand description

A Source that loads packages from the filesystem. This is a good source to use for development, or if you don’t care about packaging your data files into an archive.

Implementations

impl FilesystemSource[src]

pub fn new(directory: &str, trust: TrustLevel) -> FilesystemSource[src]

Creates a new FilesystemSource using the given directory to look for packages in

Trait Implementations

impl Source for FilesystemSource[src]

fn get_uri(&self) -> &str[src]

The path that this Source originates from. Only used for debug purposes.

fn has_package(&self, package_name: &str) -> bool[src]

Returns true if the Source has a package of the given name, otherwise returns false

fn list_packages(&mut self) -> Vec<String>[src]

Returns a list of all packages available in this Source. Do not call this repeatedly!

fn read_file(
    &mut self,
    full_pathname: &str
) -> Result<Box<dyn ReadSeek>, PackageError>
[src]

Returns a [Read] + [Seek] for the file at the given pathname, if one exists.

fn write_file(
    &mut self,
    full_pathname: &str
) -> Result<Box<dyn Write>, PackageError>
[src]

Returns a Write for the file at the given pathname.

fn iter_entries(
    &mut self,
    package_name: &str,
    type_folder: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
[src]

Returns an iterator through the items in a given package, if the Source has said package

fn trust_level(&self, _package_name: &str) -> TrustLevel[src]

Returns the source’s trust level for the given package. Trusted sources are able to load resource types marked as requiring trust. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.