Enum ckb_resource::Resource [−][src]
Expand description
Represents a resource, which is either bundled in the CKB binary or resident in the local file system.
Variants
A resource that bundled in the CKB binary.
Fields of Bundled
bundled: StringThe identifier of the bundled resource.
A resource that resides in the local file system.
Fields of FileSystem
file: PathBufThe file path to the resource.
Implementations
Creates a reference to the resource recident in the file system.
Creates the CKB config file resource from the file system.
It searches the file name CKB_CONFIG_FILE_NAME in the directory root_dir.
Creates the CKB miner config file resource from the file system.
It searches the file name MINER_CONFIG_FILE_NAME in the directory root_dir.
Creates the RocksDB options file resource from the file system.
It searches the file name DB_OPTIONS_FILE_NAME in the directory root_dir.
Creates the bundled CKB config file resource.
Creates the bundled CKB miner config file resource.
Creates the bundled RocksDB options file resource.
Checks whether any of the bundled resource has been exported in the specified directory.
This can be used to avoid overwritting to export all the bundled resources to the specified directory.
Returns true if this is a bundled resource.
Returns true if the resource exists.
The bundled resource exists only when the identifier is included in the bundle.
The file system resource exists only when the file exists.
The parent directory of the resource.
It always returns None on bundled resource.
Modifies the file system resource to ensure the path is absolute.
If the path is relative, expand the path relative to the directory base.
Exports a bundled resource.
This function returns Ok immediatly when invoked on a file system resource.
The file is exported to the path by combining root_dir and the resource indentifier.
These bundled files can be customized for different chains using spec branches. See Template.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Resource
impl UnwindSafe for Resource
Blanket Implementations
Mutably borrows from an owned value. Read more