Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ahgamut/rust-ape-example
/ functions
Functions
519 in github.com/ahgamut/rust-ape-example
⨍
Functions
519
◇
Types & classes
118
↓ 7 callers
Method
first
Grab the first number.
src/bin/generics_assoc_items_types.rs:30
↓ 6 callers
Function
origin
()
src/bin/std_box.rs:21
↓ 6 callers
Function
print
(result: Result<i32, ParseIntError>)
src/bin/error_result_result_map.rs:21
↓ 5 callers
Function
inspect
A function which takes a `WebEvent` enum as an argument and returns nothing.
src/bin/custom_types_enum.rs:21
↓ 4 callers
Function
function
()
src/bin/mod_super.rs:4
↓ 4 callers
Method
get
(&self)
src/bin/trait_disambiguating.rs:21
↓ 3 callers
Function
borrow_i32
This function borrows an i32
src/bin/scope_borrow.rs:10
↓ 3 callers
Function
double_first
The same structure as before but rather than chain all `Results` and `Options` along, we `?` to get the inner value out immediately.
src/bin/error_multiple_error_types_reenter_question_mark.rs:23
↓ 3 callers
Function
double_first
(vec: Vec<&str>)
src/bin/error_multiple_error_types_wrap_error.rs:53
↓ 3 callers
Function
double_first
(vec: Vec<&str>)
src/bin/error_multiple_error_types_define_error_type.rs:25
↓ 3 callers
Function
double_first
(vec: Vec<&str>)
src/bin/error_multiple_error_types_boxing_errors.rs:21
↓ 3 callers
Function
eat
(food: Food, day: Day)
src/bin/error_option_unwrap_and_then.rs:42
↓ 3 callers
Function
eat
Check whether there's food or not before trying to eat it!
src/bin/error_option_unwrap_map.rs:44
↓ 3 callers
Function
function
Use the `pub` modifier to override default visibility.
src/bin/mod_visibility.rs:12
↓ 3 callers
Function
give_adult
The adult has seen it all, and can handle any drink well. All drinks are handled explicitly using `match`.
src/bin/error_option_unwrap.rs:6
↓ 3 callers
Function
help
()
src/bin/std_misc_arg_matching.rs:14
↓ 3 callers
Function
is_divisible_by
Function that returns a boolean value
src/bin/fn.rs:11
↓ 3 callers
Method
len
Return the length of the list
src/bin/custom_types_enum_testcase_linked_list.rs:28
↓ 3 callers
Method
prepend
Consume a list, and return the same list with a new element at its front
src/bin/custom_types_enum_testcase_linked_list.rs:22
↓ 3 callers
Function
print
(result: Result<i32>)
src/bin/error_multiple_error_types_reenter_question_mark.rs:29
↓ 3 callers
Function
print
(result: Result<i32>)
src/bin/error_multiple_error_types_wrap_error.rs:62
↓ 3 callers
Function
print
(result: Result<i32>)
src/bin/error_multiple_error_types_define_error_type.rs:37
↓ 3 callers
Function
print
(result: Result<i32>)
src/bin/error_multiple_error_types_boxing_errors.rs:31
↓ 3 callers
Function
print_one
One input reference with lifetime `'a` which must live at least as long as the function.
src/bin/scope_lifetime_fn.rs:6
↓ 2 callers
Function
analyze_slice
This function borrows a slice
src/bin/primitives_array.rs:7
↓ 2 callers
Function
borrow_book
This function takes a reference to a book
src/bin/scope_borrow_mut.rs:14
↓ 2 callers
Function
call_me
Define a function which takes a generic `F` argument bounded by `Fn`, and calls it
src/bin/fn_closures_input_functions.rs:6
↓ 2 callers
Function
chop
Chopping food. If there isn't any, then return `None`. Otherwise, return the chopped food.
src/bin/error_option_unwrap_map.rs:23
↓ 2 callers
Function
cook
Cooking food. Here, we showcase `map()` instead of `match` for case handling.
src/bin/error_option_unwrap_map.rs:31
↓ 2 callers
Function
drink
(beverage: &str)
src/bin/error_abort_unwind.rs:26
↓ 2 callers
Function
drink
(beverage: &str)
src/bin/error_panic.rs:4
↓ 2 callers
Function
drink
Others will `panic` before drinking sugary drinks. All drinks are handled implicitly using `unwrap`.
src/bin/error_option_unwrap.rs:17
↓ 2 callers
Function
fibonacci
Returns a Fibonacci sequence generator
src/bin/trait_iter.rs:34
↓ 2 callers
Function
have_recipe
We have the recipe for everything except Cordon Bleu.
src/bin/error_option_unwrap_and_then.rs:18
↓ 2 callers
Method
is_naked
(&self)
src/bin/trait.rs:21
↓ 2 callers
Function
is_odd
(n: u32)
src/bin/fn_hof.rs:4
↓ 2 callers
Function
multiply
With the return type rewritten, we use pattern matching without `unwrap()`.
src/bin/error_result_result_map.rs:7
↓ 2 callers
Function
multiply
(first_number_str: &str, second_number_str: &str)
src/bin/error_result_enter_question_mark.rs:6
↓ 2 callers
Function
multiply
(first_number_str: &str, second_number_str: &str)
src/bin/error_result.rs:4
↓ 2 callers
Function
multiply
(first_number_str: &str, second_number_str: &str)
src/bin/error_result_early_returns.rs:6
↓ 2 callers
Function
multiply
Use the above alias to refer to our specific `Result` type.
src/bin/error_result_result_alias.rs:10
↓ 2 callers
Function
multiply2
As with `Option`, we can use combinators such as `map()`. This function is otherwise identical to the one above and reads: Modify n if the value is va
src/bin/error_result_result_map.rs:41
↓ 2 callers
Function
peel
Peeling food. If there isn't any, then return `None`. Otherwise, return the peeled food.
src/bin/error_option_unwrap_map.rs:14
↓ 2 callers
Function
print
(result: Result<i32, ParseIntError>)
src/bin/error_result_enter_question_mark.rs:13
↓ 2 callers
Function
print
(result: Result<i32, ParseIntError>)
src/bin/error_result_early_returns.rs:20
↓ 2 callers
Function
print
Here, the alias again allows us to save some space.
src/bin/error_result_result_alias.rs:17
↓ 2 callers
Method
talk
Default trait methods can be overridden.
src/bin/trait.rs:57
↓ 2 callers
Function
try_division
This function handles a division that may not succeed
src/bin/std_option.rs:16
↓ 2 callers
Function
try_logon
(accounts: &Accounts<'a>, username: &'a str, password: &'a str)
src/bin/std_hash_alt_key_types.rs:19
↓ 1 callers
Function
add_one
Mutable references are possible with lifetimes as well.
src/bin/scope_lifetime_fn.rs:11
↓ 1 callers
Method
add_one
Annotate lifetimes as in a standalone function.
src/bin/scope_lifetime_methods.rs:8
↓ 1 callers
Function
age
A function `age` which returns a `u32`.
src/bin/flow_control_match_binding.rs:5
↓ 1 callers
Function
ah
()
src/bin/error_abort_unwind.rs:21
↓ 1 callers
Function
annotated_input
(x: &'a i32)
src/bin/scope_lifetime_elision.rs:10
↓ 1 callers
Function
apply
`F` must implement `Fn` for a closure which takes no inputs and returns nothing - exactly what is required for `print`.
src/bin/fn_closures_anonymity.rs:7
↓ 1 callers
Function
apply
A function which takes a closure as an argument and calls it. <F> denotes that F is a "Generic type parameter"
src/bin/fn_closures_input_parameters.rs:6
↓ 1 callers
Function
are_you_on_linux
()
src/bin/attribute_cfg.rs:6
↓ 1 callers
Method
area
(&self)
src/bin/generics_bounds.rs:12
↓ 1 callers
Function
boxed_origin
()
src/bin/std_box.rs:25
↓ 1 callers
Function
call_public_function_in_my_mod
()
src/bin/mod_visibility.rs:54
↓ 1 callers
Function
checked_division
An integer division that doesn't `panic!`
src/bin/std_option.rs:5
↓ 1 callers
Function
combine_vecs
This is the exact same function, but its return type uses `impl Trait`. Look how much simpler it is!
src/bin/trait_impl_trait.rs:47
↓ 1 callers
Function
compare_prints
(t: &T)
src/bin/generics_multi_bounds.rs:6
↓ 1 callers
Function
compare_types
(t: &T, u: &U)
src/bin/generics_multi_bounds.rs:11
↓ 1 callers
Function
conditional_function
#[cfg(some_condition)]*/
src/bin/attribute_cfg_custom.rs:5
↓ 1 callers
Method
contains
`&Self::A` and `&Self::B` are also valid here.
src/bin/generics_assoc_items_types.rs:26
↓ 1 callers
Function
cookable_v2
This can conveniently be rewritten more compactly with `and_then()`:
src/bin/error_option_unwrap_and_then.rs:38
↓ 1 callers
Function
create_box
raii.rs
src/bin/scope_raii.rs:5
↓ 1 callers
Function
create_fn
()
src/bin/fn_closures_output_parameters.rs:4
↓ 1 callers
Function
create_fnmut
()
src/bin/fn_closures_output_parameters.rs:10
↓ 1 callers
Function
create_fnonce
()
src/bin/fn_closures_output_parameters.rs:16
↓ 1 callers
Function
decrease
(number: i32)
src/bin/std_misc_arg_matching.rs:10
↓ 1 callers
Method
destroy
This method "consumes" the resources of the caller object `self` desugars to `self: Self`
src/bin/fn_methods.rs:69
↓ 1 callers
Function
destroy_box
This function takes ownership of the heap allocated memory
src/bin/scope_move.rs:5
↓ 1 callers
Function
div
(x: f64, y: f64)
src/bin/std_result.rs:15
↓ 1 callers
Function
div
(x: f64, y: f64)
src/bin/std_result_question_mark.rs:14
↓ 1 callers
Function
division
Re-implementation of integer division (/)
src/bin/std_panic.rs:5
↓ 1 callers
Method
double_drop
This method takes ownership of both passed arguments, deallocating both.
src/bin/generics_gen_trait.rs:20
↓ 1 callers
Function
double_positives
(numbers: &'a Vec<i32>)
src/bin/trait_impl_trait.rs:77
↓ 1 callers
Function
eat_box_i32
This function takes ownership of a box and destroys it
src/bin/scope_borrow.rs:5
↓ 1 callers
Function
elided_input
`elided_input` and `annotated_input` essentially have identical signatures because the lifetime of `elided_input` is inferred by the compiler:
src/bin/scope_lifetime_elision.rs:6
↓ 1 callers
Function
failed_borrow
A function which takes no arguments, but has a lifetime parameter `'a`.
src/bin/scope_lifetime_explicit.rs:12
↓ 1 callers
Method
first
Grab the first number.
src/bin/generics_assoc_items_the_problem.rs:21
↓ 1 callers
Function
fizzbuzz
Functions that "don't" return a value, actually return the unit type `()`
src/bin/fn.rs:22
↓ 1 callers
Function
fizzbuzz_to
When a function returns `()`, the return type can be omitted from the signature
src/bin/fn.rs:36
↓ 1 callers
Function
gen_spec_i32
Define a function `gen_spec_i32` that takes an argument `_s` of type `SGen<i32>`. It has been explicitly given the type parameter `i32`, which is a sp
src/bin/generics_gen_fn.rs:23
↓ 1 callers
Function
gen_spec_t
Define a function `gen_spec_t` that takes an argument `_s` of type `SGen<T>`. It has been explicitly given the type parameter `A`, but because `A` has
src/bin/generics_gen_fn.rs:18
↓ 1 callers
Function
generic
Define a function `generic` that takes an argument `_s` of type `SGen<T>`. Because `SGen<T>` is preceded by `<T>`, this function is generic over `T`.
src/bin/generics_gen_fn.rs:27
↓ 1 callers
Function
have_ingredients
We don't have the ingredients to make Sushi.
src/bin/error_option_unwrap_and_then.rs:10
↓ 1 callers
Function
increase
(number: i32)
src/bin/std_misc_arg_matching.rs:6
↓ 1 callers
Function
indirect_access
Items can access other items in the same module, even when private.
src/bin/mod_visibility.rs:18
↓ 1 callers
Function
indirect_call
()
src/bin/mod_super.rs:25
↓ 1 callers
Method
last
Grab the last number.
src/bin/generics_assoc_items_the_problem.rs:24
↓ 1 callers
Method
last
Grab the last number.
src/bin/generics_assoc_items_types.rs:33
↓ 1 callers
Function
ln
(x: f64)
src/bin/std_result.rs:34
↓ 1 callers
Function
ln
(x: f64)
src/bin/std_result_question_mark.rs:30
↓ 1 callers
Function
make_adder_function
Returns a function that adds `y` to its input
src/bin/trait_impl_trait.rs:67
↓ 1 callers
Function
new_edition
This function takes a reference to a mutable book and changes `year` to 2014
src/bin/scope_borrow_mut.rs:19
↓ 1 callers
Function
op
(x: f64, y: f64)
src/bin/std_result_question_mark.rs:49
↓ 1 callers
Function
op_
Intermediate function
src/bin/std_result_question_mark.rs:39
next →
1–100 of 519, ranked by callers