Struct ggez::filesystem::OpenOptions
source · pub struct OpenOptions { /* private fields */ }
Expand description
Options for opening files
We need our own version of this structure because the one in
std
annoyingly doesn’t let you read the read/write/create/etc
state out of it.
Implementations§
source§impl OpenOptions
impl OpenOptions
sourcepub fn new() -> OpenOptions
pub fn new() -> OpenOptions
Create a new instance
sourcepub fn read(self, read: bool) -> OpenOptions
pub fn read(self, read: bool) -> OpenOptions
Open for reading
sourcepub fn write(self, write: bool) -> OpenOptions
pub fn write(self, write: bool) -> OpenOptions
Open for writing
sourcepub fn create(self, create: bool) -> OpenOptions
pub fn create(self, create: bool) -> OpenOptions
Create the file if it does not exist yet
sourcepub fn append(self, append: bool) -> OpenOptions
pub fn append(self, append: bool) -> OpenOptions
Append at the end of the file
sourcepub fn truncate(self, truncate: bool) -> OpenOptions
pub fn truncate(self, truncate: bool) -> OpenOptions
Truncate the file to 0 bytes after opening
Trait Implementations§
source§impl Clone for OpenOptions
impl Clone for OpenOptions
source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OpenOptions
impl Debug for OpenOptions
source§impl Default for OpenOptions
impl Default for OpenOptions
source§fn default() -> OpenOptions
fn default() -> OpenOptions
Returns the “default value” for a type. Read more
source§impl PartialEq<OpenOptions> for OpenOptions
impl PartialEq<OpenOptions> for OpenOptions
source§fn eq(&self, other: &OpenOptions) -> bool
fn eq(&self, other: &OpenOptions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for OpenOptions
impl Eq for OpenOptions
impl StructuralEq for OpenOptions
impl StructuralPartialEq for OpenOptions
Auto Trait Implementations§
impl RefUnwindSafe for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Unpin for OpenOptions
impl UnwindSafe for OpenOptions
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.