Crate tcplane

Source

Re-exports§

pub use once_cell;
pub use serde;
pub use serde_json;
pub use simd_json;
pub use tokio;

Modules§

async
sync

Macros§

arc
Arc macro
async_func
Creates an asynchronous function that takes a closure with parameters and executes it asynchronously.
b_tree_map
A macro to create a new BTreeMap, providing two usage options:
b_tree_set
Creates a new BTreeSet<T>.
binary_heap
Creates a new BinaryHeap<T>.
boxed
Creates a new Box instance.
cell
Creates a new Cell instance.
clone
The clone! macro automatically clones the variables passed to it and immediately executes the closure.
hash_map
Creates a new HashMap instance.
hash_set
Creates a new HashSet instance.
join_paths
Combines multiple paths into a single valid path, handling overlapping slashes.
linked_list
Creates a new LinkedList instance.
mutex
Creates a new Mutex instance.
output_macro
Output macro
print_danger
print_success
print_warning
println_danger
println_success
println_warning
rc
Creates a new Rc (Reference Counted) instance.
refcell
Creates a new RefCell instance.
rw_lock
Creates a new RwLock instance.
string
Creates a new String instance.
vector
Creates a new Vec instance.
vector_deque
Creates a new VecDeque instance.

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
BTreeMap
An ordered map based on a B-Tree.
BTreeSet
An ordered set based on a B-Tree.
BinaryHeap
A priority queue implemented with a binary heap.
Box
A pointer type that uniquely owns a heap allocation of type T.
Cell
A mutable memory location.
ControllerData
FileDataString
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HashSet
A hash set implemented as a HashMap where the value is ().
JoinHandle
An owned permission to join on a thread (block on its termination).
LinkedList
A doubly-linked list with owned nodes.
Log
Mutex
A mutual exclusion primitive useful for protecting shared data
MutexGuard
An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
Output
Output struct
OutputBuilder
OutputBuilder struct
OutputList
OutputList struct
OutputListBuilder
OutputListBuilder struct
PathBuf
An owned, mutable path (akin to String).
Rc
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
RefCell
A mutable memory location with dynamically checked borrow rules
RequestBuilder
Response
RwLock
A reader-writer lock
Server
ThreadPool
VecDeque
A double-ended queue implemented with a growable ring buffer.
Worker

Enums§

Color
Color
ColorType
ColorType
RequestError
ServerError

Statics§

DEBUG_DIR
DEFAULT_LOG_DIR
DEFAULT_LOG_FILE_SIZE
DEFAULT_LOG_FILE_START_IDX
DEFAULT_LOG_INTERVAL_MILLIS
ERROR_DIR
INFO_DIR
LOG_EXTION

Traits§

AsyncErrorHandlerFunction
Trait alias for asynchronous error-handling functions used in a recoverable context.
AsyncRecoverableFunction
Trait alias for asynchronous functions that can be executed in a recoverable context.
ErrorHandlerFunction
Trait alias for error-handling functions used in a recoverable context.
FunctionMutTrait
Trait alias for functions that can be executed in a recoverable context.
FunctionOnceTrait
Trait alias for functions that can be executed in a recoverable context.
FunctionTrait
Trait alias for functions that can be executed in a recoverable context.
LogDataTrait
LogFuncTrait
RecoverableFunction
Trait alias for functions that can be executed in a recoverable context.
RequestTrait
ResponseTrait

Functions§

append_to_file
Append the provided content to a file at the specified file_path. If the file does not exist, it will be created. If the file exists, the content will be appended to it.
async_append_to_file
Append the provided content to a file at the specified file_path asynchronously.
async_copy_dir_files
Asynchronously copies all files from the source directory to the destination directory.
async_copy_file
Asynchronously copies a file from the source path to the destination path.
async_delete_dir
Asynchronously deletes a directory and all its contents.
async_delete_file
Asynchronously deletes a file at the given path.
async_get_file_size
Retrieves the size of a file at the specified file_path in bytes.
async_move_dir
Moves a directory and all its contents to another location asynchronously.
async_move_file
Moves a file from the source path to the destination path asynchronously.
async_read_from_file
Reads the content of a file at the specified file_path and converts it to the type T. The conversion is done by using the From<Vec<u8>> trait, which allows the file content (read as raw bytes) to be converted into a type T.
async_write_to_file
Writes the provided content to a file at the specified file_path asynchronously.
copy_dir_files
Copies all files from the source directory to the destination directory.
copy_file
Copies a file from the source path to the destination path.
current_date
Gets the current day, without the time.
current_time
Gets the current time, including the date and time.
delete_dir
Deletes a directory and all its contents.
delete_file
Deletes a file at the given path.
get_file_size
Retrieves the size of a file at the specified file_path in bytes.
get_read_controller_data
get_rw_lock_read_controller_data
get_rw_lock_write_controller_data
get_thread_count
get_write_controller_data
log_debug_format_handler
log_debug_handler
log_handler
log_run
move_dir
Moves a directory and all its contents to another location.
move_file
Moves a file from the source path to the destination path.
output
Output
read_from_file
Reads the content of a file at the specified file_path and converts it to the type T. The conversion is done by using the From<Vec<u8>> trait, which allows the file content (read as raw bytes) to be converted into a type T.
write_to_file
Writes the provided content to a file at the specified file_path. If the file does not exist, it will be created. If the file exists, the content will be appended to it.

Type Aliases§

ArcAsyncErrorHandlerFunction
Alias for an Arc-wrapped error handler function.
ArcAsyncRecoverableFunction
Alias for an Arc-wrapped recoverable function.
ArcLogFunc
ArcRwLockControllerData
ArcTcpStream
AsyncSpawnResult
Type alias for the result type returned by spawnable functions.
BoxAnySend
Type alias for a boxed dynamic type that implements Any and Send.
BoxRequestTrait
BoxResponseTrait
ListLog
LogArcLock
LogFunc
LogListArcLock
OptionArcTcpStream
Request
ResponseData
ResponseResult
RwLockReadControllerData
RwLockWriteControllerData
SendErrorBox
SendResult
SpawnResult
Type alias for the result type returned by spawnable functions.
TcpResponseBinary
TcpResponseText
ThreadPoolJob

Derive Macros§

Lombok
This is an example of how to use the Lombok procedural macro with get and set attributes.