Macro build_fs_tree::file [−][src]
macro_rules! file { ($content:expr) => { ... }; }
Expand description
Create representation of a file.
Syntax
Example:
use build_fs_tree::{FileSystemTree, file}; let file: FileSystemTree<&str, &str> = file!("CONTENT OF THE FILE"); assert_eq!(file, FileSystemTree::File("CONTENT OF THE FILE"));
Typings
This macro calls From::from
under the hood.
Example: Where FileContent
is a String
use build_fs_tree::{FileSystemTree, file}; let file: FileSystemTree<&str, String> = file!("CONTENT OF THE FILE"); assert_eq!(file, FileSystemTree::File("CONTENT OF THE FILE".to_string()));
Example: Where FileContent
is a Vec<u8>
use build_fs_tree::{FileSystemTree, file}; let file: FileSystemTree<&str, Vec<u8>> = file!("CONTENT OF THE FILE"); assert_eq!(file, FileSystemTree::File("CONTENT OF THE FILE".into()));