[−][src]Struct buildtime_png::Builder
Methods
impl Builder
[src]
pub fn new() -> Self
[src]
Simply calls Builder::default().
pub fn with_out_dir<P: AsRef<Path>>(&mut self, outdir: P) -> &mut Self
[src]
Customize where the pixel .data files are placed in.
Because absolute paths is used in the generated rust code, you do not have to worry about where these files are, usually.
Default is OUT_DIR
pub fn include_png<P: AsRef<Path>>(
&mut self,
path_rel_to_root: P,
ident: &str
) -> &mut Self
[src]
&mut self,
path_rel_to_root: P,
ident: &str
) -> &mut Self
Add a image.
This method will read the image pointed to by path_rel_to_root
, decode it, and
emits relevant .data files into the out_dir perviously set (default to OUT_DIR).
Arguments
path_rel_to_root
- Path of the image, relative to the directory where yourCargo.toml
is placed.
ident
- An identifier for the image to use in your code. Must be valid rust identifiers, such
as image
, left_arrow
and not 123
, a/b
, a b
, a-b
or a::b
.
pub fn emit_source_file(&self) -> Result<()>
[src]
Emit the rust source file to $OUTDIR/image.rs
pub fn emit_source_file_at<P: AsRef<Path>>(&self, path: P) -> Result<()>
[src]
Emit the rust source file to the provided path, relative to the output directory.
Source file contains absolute paths, so you don't have to worry about the placement of it.
Trait Implementations
Auto Trait Implementations
impl Sync for Builder
impl Unpin for Builder
impl Send for Builder
impl UnwindSafe for Builder
impl RefUnwindSafe for Builder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,