MCPcopy Create free account

hub / github.com/ahgamut/rust-ape-example / functions

Functions519 in github.com/ahgamut/rust-ape-example

↓ 7 callersMethodfirst
Grab the first number.
src/bin/generics_assoc_items_types.rs:30
↓ 6 callersFunctionorigin
()
src/bin/std_box.rs:21
↓ 6 callersFunctionprint
(result: Result<i32, ParseIntError>)
src/bin/error_result_result_map.rs:21
↓ 5 callersFunctioninspect
A function which takes a `WebEvent` enum as an argument and returns nothing.
src/bin/custom_types_enum.rs:21
↓ 4 callersFunctionfunction
()
src/bin/mod_super.rs:4
↓ 4 callersMethodget
(&self)
src/bin/trait_disambiguating.rs:21
↓ 3 callersFunctionborrow_i32
This function borrows an i32
src/bin/scope_borrow.rs:10
↓ 3 callersFunctiondouble_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 callersFunctiondouble_first
(vec: Vec<&str>)
src/bin/error_multiple_error_types_wrap_error.rs:53
↓ 3 callersFunctiondouble_first
(vec: Vec<&str>)
src/bin/error_multiple_error_types_define_error_type.rs:25
↓ 3 callersFunctiondouble_first
(vec: Vec<&str>)
src/bin/error_multiple_error_types_boxing_errors.rs:21
↓ 3 callersFunctioneat
(food: Food, day: Day)
src/bin/error_option_unwrap_and_then.rs:42
↓ 3 callersFunctioneat
Check whether there's food or not before trying to eat it!
src/bin/error_option_unwrap_map.rs:44
↓ 3 callersFunctionfunction
Use the `pub` modifier to override default visibility.
src/bin/mod_visibility.rs:12
↓ 3 callersFunctiongive_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 callersFunctionhelp
()
src/bin/std_misc_arg_matching.rs:14
↓ 3 callersFunctionis_divisible_by
Function that returns a boolean value
src/bin/fn.rs:11
↓ 3 callersMethodlen
Return the length of the list
src/bin/custom_types_enum_testcase_linked_list.rs:28
↓ 3 callersMethodprepend
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 callersFunctionprint
(result: Result<i32>)
src/bin/error_multiple_error_types_reenter_question_mark.rs:29
↓ 3 callersFunctionprint
(result: Result<i32>)
src/bin/error_multiple_error_types_wrap_error.rs:62
↓ 3 callersFunctionprint
(result: Result<i32>)
src/bin/error_multiple_error_types_define_error_type.rs:37
↓ 3 callersFunctionprint
(result: Result<i32>)
src/bin/error_multiple_error_types_boxing_errors.rs:31
↓ 3 callersFunctionprint_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 callersFunctionanalyze_slice
This function borrows a slice
src/bin/primitives_array.rs:7
↓ 2 callersFunctionborrow_book
This function takes a reference to a book
src/bin/scope_borrow_mut.rs:14
↓ 2 callersFunctioncall_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 callersFunctionchop
Chopping food. If there isn't any, then return `None`. Otherwise, return the chopped food.
src/bin/error_option_unwrap_map.rs:23
↓ 2 callersFunctioncook
Cooking food. Here, we showcase `map()` instead of `match` for case handling.
src/bin/error_option_unwrap_map.rs:31
↓ 2 callersFunctiondrink
(beverage: &str)
src/bin/error_abort_unwind.rs:26
↓ 2 callersFunctiondrink
(beverage: &str)
src/bin/error_panic.rs:4
↓ 2 callersFunctiondrink
Others will `panic` before drinking sugary drinks. All drinks are handled implicitly using `unwrap`.
src/bin/error_option_unwrap.rs:17
↓ 2 callersFunctionfibonacci
Returns a Fibonacci sequence generator
src/bin/trait_iter.rs:34
↓ 2 callersFunctionhave_recipe
We have the recipe for everything except Cordon Bleu.
src/bin/error_option_unwrap_and_then.rs:18
↓ 2 callersMethodis_naked
(&self)
src/bin/trait.rs:21
↓ 2 callersFunctionis_odd
(n: u32)
src/bin/fn_hof.rs:4
↓ 2 callersFunctionmultiply
With the return type rewritten, we use pattern matching without `unwrap()`.
src/bin/error_result_result_map.rs:7
↓ 2 callersFunctionmultiply
(first_number_str: &str, second_number_str: &str)
src/bin/error_result_enter_question_mark.rs:6
↓ 2 callersFunctionmultiply
(first_number_str: &str, second_number_str: &str)
src/bin/error_result.rs:4
↓ 2 callersFunctionmultiply
(first_number_str: &str, second_number_str: &str)
src/bin/error_result_early_returns.rs:6
↓ 2 callersFunctionmultiply
Use the above alias to refer to our specific `Result` type.
src/bin/error_result_result_alias.rs:10
↓ 2 callersFunctionmultiply2
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 callersFunctionpeel
Peeling food. If there isn't any, then return `None`. Otherwise, return the peeled food.
src/bin/error_option_unwrap_map.rs:14
↓ 2 callersFunctionprint
(result: Result<i32, ParseIntError>)
src/bin/error_result_enter_question_mark.rs:13
↓ 2 callersFunctionprint
(result: Result<i32, ParseIntError>)
src/bin/error_result_early_returns.rs:20
↓ 2 callersFunctionprint
Here, the alias again allows us to save some space.
src/bin/error_result_result_alias.rs:17
↓ 2 callersMethodtalk
Default trait methods can be overridden.
src/bin/trait.rs:57
↓ 2 callersFunctiontry_division
This function handles a division that may not succeed
src/bin/std_option.rs:16
↓ 2 callersFunctiontry_logon
(accounts: &Accounts<'a>, username: &'a str, password: &'a str)
src/bin/std_hash_alt_key_types.rs:19
↓ 1 callersFunctionadd_one
Mutable references are possible with lifetimes as well.
src/bin/scope_lifetime_fn.rs:11
↓ 1 callersMethodadd_one
Annotate lifetimes as in a standalone function.
src/bin/scope_lifetime_methods.rs:8
↓ 1 callersFunctionage
A function `age` which returns a `u32`.
src/bin/flow_control_match_binding.rs:5
↓ 1 callersFunctionah
()
src/bin/error_abort_unwind.rs:21
↓ 1 callersFunctionannotated_input
(x: &'a i32)
src/bin/scope_lifetime_elision.rs:10
↓ 1 callersFunctionapply
`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 callersFunctionapply
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 callersFunctionare_you_on_linux
()
src/bin/attribute_cfg.rs:6
↓ 1 callersMethodarea
(&self)
src/bin/generics_bounds.rs:12
↓ 1 callersFunctionboxed_origin
()
src/bin/std_box.rs:25
↓ 1 callersFunctioncall_public_function_in_my_mod
()
src/bin/mod_visibility.rs:54
↓ 1 callersFunctionchecked_division
An integer division that doesn't `panic!`
src/bin/std_option.rs:5
↓ 1 callersFunctioncombine_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 callersFunctioncompare_prints
(t: &T)
src/bin/generics_multi_bounds.rs:6
↓ 1 callersFunctioncompare_types
(t: &T, u: &U)
src/bin/generics_multi_bounds.rs:11
↓ 1 callersFunctionconditional_function
#[cfg(some_condition)]*/
src/bin/attribute_cfg_custom.rs:5
↓ 1 callersMethodcontains
`&Self::A` and `&Self::B` are also valid here.
src/bin/generics_assoc_items_types.rs:26
↓ 1 callersFunctioncookable_v2
This can conveniently be rewritten more compactly with `and_then()`:
src/bin/error_option_unwrap_and_then.rs:38
↓ 1 callersFunctioncreate_box
raii.rs
src/bin/scope_raii.rs:5
↓ 1 callersFunctioncreate_fn
()
src/bin/fn_closures_output_parameters.rs:4
↓ 1 callersFunctioncreate_fnmut
()
src/bin/fn_closures_output_parameters.rs:10
↓ 1 callersFunctioncreate_fnonce
()
src/bin/fn_closures_output_parameters.rs:16
↓ 1 callersFunctiondecrease
(number: i32)
src/bin/std_misc_arg_matching.rs:10
↓ 1 callersMethoddestroy
This method "consumes" the resources of the caller object `self` desugars to `self: Self`
src/bin/fn_methods.rs:69
↓ 1 callersFunctiondestroy_box
This function takes ownership of the heap allocated memory
src/bin/scope_move.rs:5
↓ 1 callersFunctiondiv
(x: f64, y: f64)
src/bin/std_result.rs:15
↓ 1 callersFunctiondiv
(x: f64, y: f64)
src/bin/std_result_question_mark.rs:14
↓ 1 callersFunctiondivision
Re-implementation of integer division (/)
src/bin/std_panic.rs:5
↓ 1 callersMethoddouble_drop
This method takes ownership of both passed arguments, deallocating both.
src/bin/generics_gen_trait.rs:20
↓ 1 callersFunctiondouble_positives
(numbers: &'a Vec<i32>)
src/bin/trait_impl_trait.rs:77
↓ 1 callersFunctioneat_box_i32
This function takes ownership of a box and destroys it
src/bin/scope_borrow.rs:5
↓ 1 callersFunctionelided_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 callersFunctionfailed_borrow
A function which takes no arguments, but has a lifetime parameter `'a`.
src/bin/scope_lifetime_explicit.rs:12
↓ 1 callersMethodfirst
Grab the first number.
src/bin/generics_assoc_items_the_problem.rs:21
↓ 1 callersFunctionfizzbuzz
Functions that "don't" return a value, actually return the unit type `()`
src/bin/fn.rs:22
↓ 1 callersFunctionfizzbuzz_to
When a function returns `()`, the return type can be omitted from the signature
src/bin/fn.rs:36
↓ 1 callersFunctiongen_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 callersFunctiongen_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 callersFunctiongeneric
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 callersFunctionhave_ingredients
We don't have the ingredients to make Sushi.
src/bin/error_option_unwrap_and_then.rs:10
↓ 1 callersFunctionincrease
(number: i32)
src/bin/std_misc_arg_matching.rs:6
↓ 1 callersFunctionindirect_access
Items can access other items in the same module, even when private.
src/bin/mod_visibility.rs:18
↓ 1 callersFunctionindirect_call
()
src/bin/mod_super.rs:25
↓ 1 callersMethodlast
Grab the last number.
src/bin/generics_assoc_items_the_problem.rs:24
↓ 1 callersMethodlast
Grab the last number.
src/bin/generics_assoc_items_types.rs:33
↓ 1 callersFunctionln
(x: f64)
src/bin/std_result.rs:34
↓ 1 callersFunctionln
(x: f64)
src/bin/std_result_question_mark.rs:30
↓ 1 callersFunctionmake_adder_function
Returns a function that adds `y` to its input
src/bin/trait_impl_trait.rs:67
↓ 1 callersFunctionnew_edition
This function takes a reference to a mutable book and changes `year` to 2014
src/bin/scope_borrow_mut.rs:19
↓ 1 callersFunctionop
(x: f64, y: f64)
src/bin/std_result_question_mark.rs:49
↓ 1 callersFunctionop_
Intermediate function
src/bin/std_result_question_mark.rs:39
next →1–100 of 519, ranked by callers