#linked-list #array #return #value

easy_linked_list

easy linked list is easy to work

5 releases

0.1.4 Apr 8, 2024
0.1.3 Apr 8, 2024
0.1.2 Apr 8, 2024
0.1.1 Apr 8, 2024
0.1.0 Apr 8, 2024

#11 in #return

MIT license

21KB
245 lines

Welcome to easy_linked_list!

Hi! I'm saeed safi and worked as backend developer for 3 years. I want to introduce some part of code that I managed for you to make work with arrays much easier. before start you should know: all functions return option type when you want to get value from them you should use :

match  your_list_name.get_by_index(1) {
Some(z) =>  println!("{:?}", z),
None  =>  println!("not found"),
}

otherwise it returns something like this => some(value) we are trying to handle it in other version of the package in future.

Functions

  • add => insert to list
  • last => return last element of list
  • first => return first element of list
  • get-index => return index of
  • next => return next element in the list
  • is_last_index => return the value is last index in list or not
  • to_array => return simple rust array
  • get_by_index => return value by specific index
  • remove_index => remove element by specific index
  • clear => remove all element from list

if you have a suggestion you can comunicate with my email in my account thanks for your attention

No runtime deps