Module v.embed_file stdlib

v.embed_file
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
1
Imported by:
7
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

  • Standard Library

Aliases

This section is empty.

Constants

#constant is_used

is_used = 1

Sum types

This section is empty.

Functions

#fn find_index_entry_by_path

fn find_index_entry_by_path(start voidptr, path string, algo string) &EmbedFileIndexEntry

find_index_entry_by_path is used internally by the V compiler:

#fn register_decoder

fn register_decoder(compression_type string, decoder Decoder)

Structs

#struct EmbedFileData

pub struct EmbedFileData {
	apath            string
	compression_type string
mut:
	compressed        &u8 = unsafe { nil }
	uncompressed      &u8 = unsafe { nil }
	free_compressed   bool
	free_uncompressed bool
pub:
	len  int
	path string
}

EmbedFileData encapsulates functionality for the $embed_file() compile time call.

fn (ed EmbedFileData) str() string

#fn (&EmbedFileData) free

unsafe
fn (mut ed &EmbedFileData) free()

#fn (&EmbedFileData) to_string

fn (original &EmbedFileData) to_string() string

#fn (&EmbedFileData) to_bytes

fn (original &EmbedFileData) to_bytes() []u8

#fn (&EmbedFileData) data

fn (mut ed &EmbedFileData) data() &u8

#struct EmbedFileIndexEntry

pub struct EmbedFileIndexEntry {
	id   int
	path string
	algo string
	data &u8 = unsafe { nil }
}

//////////////////////////////////////////////////////////////////////////// EmbedFileIndexEntry is used internally by the V compiler when you compile a program that uses $embed_file('file.bin') in -prod mode.

V will generate a static index of all embedded files, and will call the find_index_entry_by_path over the index and the relative paths of the embeds.

Note: these are public on purpose, to help -usecache.

Interfaces

This section is empty.

Enums

This section is empty.