Expand description
Some tools and enhancements to the used libraries, there should be no references to Context and other “larger” entities here.
Structs§
- Struct containing all mailto information
- A measurement of the system clock, useful for talking to external entities like the file system or other processes.
- A guard which will remove the path when dropped.
- A measurement of the system clock, useful for talking to external entities like the file system or other processes.
Constants§
- Compressor/decompressor buffer size.
Traits§
Functions§
- Compresses
buf
toVec
usingbrotli
. Note that it handles an emptybuf
as a special value that remains empty after compression, otherwise brotli would add its metadata to it which is not nice because this function is used for compression of strings stored in the db and empty strings are common there. This approach is not strictly correct because nowhere in the brotli documentation is said that an empty buffer can’t be a result of compression of some input, but i think this will never break. - Decompresses
buf
toVec
usingbrotli
. Seebuf_compress()
for why we don’t pass an empty buffer to brotli decompressor. - Generate an unique ID.
- Function generates a Message-ID that can be used for a new outgoing message.
- Returns a timestamp that is guaranteed to be unique.
- Converts duration to string representation suitable for logs.
- Expand paths relative to $BLOBDIR into absolute paths.
- Returns the
(width, height)
of the given image buffer. - Returns the last release timestamp as a unix timestamp compatible for comparison with time() and database times.
- Increments
*t
and checks that it equals toexpected
after that. - Parse mailto urls
- parses “receive”-headers
- Reads directory and returns a vector of directory entries.
- Reads the file and returns its context as a byte vector.
- If
collection
contains exactly one element, return this element. Otherwise, return None. - Returns the current smeared timestamp,
- time 🔒
- Converts Unix time in seconds to a local timestamp string.
- truncate 🔒Shortens a string to a specified length and adds “[…]” to the end of the shortened string.
- Shortens a string to a specified line count and adds “[…]” to the end of the shortened string.
- Shortens a message text if necessary according to the configuration. Adds “[…]” to the end of the shortened text.
- Returns true if given string is a valid ID.
- Write a the given content to provided file path.