Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Reim-developer/magical_rs
/ functions
Functions
68 in github.com/Reim-developer/magical_rs
⨍
Functions
68
◇
Types & classes
14
↓ 10 callers
Function
match_types_custom
(bytes: &[u8], rules: &[MagicCustom<K>], fallback: K)
src/magical/magic_custom.rs:719
↓ 7 callers
Function
read_file_header
(file_path: &str, max_bytes: usize)
src/magical/bytes_read.rs:144
↓ 6 callers
Method
matches
(&self, bytes: &[u8])
src/magical/dyn_magic.rs:83
↓ 6 callers
Function
with_bytes_read
()
src/magical/bytes_read.rs:83
↓ 2 callers
Method
matches
(&self, bytes: &[u8])
src/magical/async_dyn_magic.rs:42
↓ 2 callers
Function
max_bytes
(offsets: &[usize], signature: &[u8])
src/magical/bytes_read.rs:5
↓ 1 callers
Function
detect_iso
* A simple function to detect the ISO file format */
examples/normal_usage/src/main.rs:40
↓ 1 callers
Function
detect_png
* A simple example function to detect 'PNG' file. */
examples/normal_usage/src/main.rs:7
↓ 1 callers
Method
kind
(&self)
src/magical/dyn_magic.rs:93
↓ 1 callers
Method
kind
(&self)
src/magical/async_dyn_magic.rs:58
↓ 1 callers
Method
kind_arc
Returns a reference to the stored [`AsyncDynMagic::kind`], as `Arc<dyn Any + Send + Sync>`
src/magical/async_dyn_magic.rs:48
↓ 1 callers
Function
magic_async_detect
* Of course, to use this feature, you need an async function. */
examples/async_dyn_magic/src/main.rs:22
↓ 1 callers
Function
magic_custom_all
* But in this function, just one condition return false. * All will return fallback. */
examples/magic_custom/src/v_2_0_0/magic_custom_macro.rs:56
↓ 1 callers
Function
magic_custom_any
* With this function, as you can see, even though it seems like * there is a condition that `is_not_shoujo` return false. * we still get the result `S
examples/magic_custom/src/v_2_0_0/magic_custom_macro.rs:33
↓ 1 callers
Function
match_dyn_types
Find the first matching rule and returns a reference to its `kind` The returned `&dyn Any` has the same life time as the `rules` slice.
src/magical/dyn_magic.rs:119
↓ 1 callers
Function
match_dyn_types
(bytes: &[u8], rules: &'a [AsyncDynMagic])
src/magical/async_dyn_magic.rs:81
↓ 1 callers
Function
match_dyn_types_all
(bytes: &[u8], rules: &'a [DynMagicCustom])
src/magical/dyn_magic.rs:139
↓ 1 callers
Method
matches_custom
(&self, bytes: &[u8])
src/magical/magic_custom.rs:589
↓ 1 callers
Function
my_custom_magic
* Simple function to detect file with your customize * rule */
examples/magic_custom/src/main.rs:25
↓ 1 callers
Function
my_custom_magic_with_fn
* Simple function to detect file with your customize rule. * But this time. We'll add a litle magic to it. */
examples/magic_custom/src/main.rs:64
↓ 1 callers
Function
my_detect_rule
* Here you can write a function, where you can do whatever condition * you want as long as you make sure it a closure * that returns a `bool` & with a
examples/dyn_magic/src/main.rs:16
↓ 1 callers
Function
my_magic_detect
* Finnaly. We'll use magic to make things * neater */
examples/magic_custom/src/main.rs:94
Function
__from_ref
(r: &T)
src/magical/magic_custom.rs:582
Function
detect_custom_file
(file_bytes: &'static [u8])
examples/dyn_magic/src/main.rs:22
Function
detect_mikoto_chan
* This is a magic function for us * to recognize a cute girl Mikoto-chan. */
examples/magic_custom/src/main.rs:69
Function
find_shoujo_girl
(bytes: &[u8])
tests/magic_custom.rs:71
Function
is_not_shoujo
(bytes: &[u8])
examples/magic_custom/src/v_2_0_0/magic_custom_macro.rs:24
Function
is_not_shoujo_girl
(data: *const ())
tests/unsafe.rs:65
Function
is_shoujo
(bytes: &[u8])
examples/magic_custom/src/v_2_0_0/magic_custom_macro.rs:20
Function
is_shoujo_girl
(bytes: &[u8])
tests/magic_custom.rs:40
Function
is_shoujo_girl
(data: *const ())
tests/unsafe.rs:14
Function
is_shoujo_girl
(data: *const ())
examples/unsafe_context/src/main.rs:21
Function
is_webp
(bytes: &[u8])
src/magical/ext_fn/webp.rs:5
Method
kind_downcast_ref
(&self)
src/magical/dyn_magic.rs:101
Method
kind_downcast_ref
(&self)
src/magical/async_dyn_magic.rs:66
Function
main
()
examples/magic_custom/src/main.rs:137
Function
main
()
examples/async_dyn_magic/src/main.rs:70
Function
main
()
examples/unsafe_context/src/main.rs:38
Function
main
()
examples/dyn_magic/src/main.rs:50
Function
main
()
examples/normal_usage/src/main.rs:57
Function
match_dyn_types_all
Returns all matching [`AsyncDynMagic::kind`] This is the asynchronous version of function `match_dyn_types_all` in `DynMagicCustom`
src/magical/async_dyn_magic.rs:108
Function
match_dyn_types_as
( bytes: &[u8], rules: &'a [DynMagicCustom], )
src/magical/dyn_magic.rs:129
Function
match_dyn_types_as
Shorthand: returns the first matching [`AsyncDynMagic::kind`] downcasted to `&T` This is the asynchronous version of function `match_dyn_types_as` in
src/magical/async_dyn_magic.rs:96
Method
match_types
(bytes: &[u8])
src/magical/magic.rs:128
Method
match_with_custom_max_read
(bytes: &[u8], allowed_max_read: usize)
src/magical/magic.rs:274
Method
match_with_max_read_rule
(bytes: &[u8], allowed_max_read: usize)
src/magical/magic.rs:209
Method
matches
(&self, bytes: &[u8])
src/magical/signatures.rs:89
Method
max_bytes_read
(&self)
src/magical/dyn_magic.rs:109
Method
max_bytes_read
(&self)
src/magical/async_dyn_magic.rs:74
Method
new
(matcher: F, kind: K, max_bytes_read: usize)
src/magical/dyn_magic.rs:69
Method
new
(matcher: F, kind: K, max_bytes_read: usize)
src/magical/async_dyn_magic.rs:27
Function
test_all_unsafe_fn
()
tests/unsafe.rs:95
Function
test_any_unsafe_fn
()
tests/unsafe.rs:45
Function
test_class_detect
()
tests/test.rs:37
Function
test_dyn_detect_file
()
tests/dyn.rs:56
Function
test_dyn_magic_downcast
()
tests/dyn.rs:15
Function
test_dyn_magic_matches
()
tests/dyn.rs:3
Function
test_iso_detect
()
tests/test.rs:2
Function
test_match_dyn_types_all
()
tests/dyn.rs:29
Function
test_match_types_custom
()
tests/magic_custom.rs:2
Function
test_png_detect
()
tests/test.rs:22
Function
test_read_file_header
()
src/magical/bytes_read.rs:166
Function
test_unsafe_magic_custom
()
tests/unsafe.rs:3
Function
test_webp_detect
()
tests/test.rs:55
Function
test_with_all_matches
()
tests/magic_custom.rs:98
Function
test_with_any_matches
()
tests/magic_custom.rs:60
Function
test_with_custom_rules
()
tests/magic_custom.rs:30
Function
wrong_shoujo_girl
(bytes: &[u8])
tests/magic_custom.rs:75