Rust is an implementation of Rust.
Other implementations of Rust.
Rust
This programming language may be used to instruct a computer to perform a task.
Listed below are all of the tasks on Rosetta Code which have been solved using Rust.
This programming language may be used to instruct a computer to perform a task.
Official website |
---|
Execution method: | Compiled (machine code) |
---|---|
Garbage collected: | Allowed |
Type safety: | Safe |
Type strength: | Strong |
Type compatibility: | Nominative |
Type expression: | Implicit |
Type checking: | Static |
Lang tag(s): | rust |
See Also: |
|
Your Help Needed
If you know Rust, please write code for some of the tasks not implemented in Rust.
If you know Rust, please write code for some of the tasks not implemented in Rust.
Rust is a general purpose, multi-paradigm, systems programming language sponsored by Mozilla. Its goal is to provide a fast, practical, concurrent language with zero-cost abstractions and strong memory safety. It employs a unique model of ownership to eliminate data races.
Solutions to RosettaCode tasks are mirrored on GitHub at Hoverbear/rust-rosetta. If you implement a solution here, please open a pull request!
Features[edit]
From the official website:
- zero-cost abstractions
- move semantics
- guaranteed memory safety
- threads without data races
- trait-based generics
- pattern matching
- type inference
- minimal runtime
- efficient C bindings
Subcategories
This category has the following 2 subcategories, out of 2 total.
Pages in category "Rust"
The following 869 pages are in this category, out of 869 total.
A
- A+B
- Abbreviations, automatic
- Abbreviations, easy
- Abbreviations, simple
- ABC problem
- Abelian sandpile model
- Abelian sandpile model/Identity
- Abstract type
- Abundant odd numbers
- Abundant, deficient and perfect number classifications
- Accumulator factory
- Achilles numbers
- Ackermann function
- Active Directory/Connect
- Active object
- Additive primes
- Address of a variable
- Air mass
- AKS test for primes
- Align columns
- Aliquot sequence classifications
- Almost prime
- Alternade words
- Amb
- Amicable pairs
- Anagrams
- Anagrams/Deranged anagrams
- Angle difference between two bearings
- Angles (geometric), normalization and conversion
- Animate a pendulum
- Animation
- Anonymous recursion
- Anti-primes
- Append a record to the end of a text file
- Apply a callback to an array
- Apply a digital filter (direct form II transposed)
- Approximate equality
- Arbitrary-precision integers (included)
- Archimedean spiral
- Arena storage pool
- Arithmetic evaluation
- Arithmetic-geometric mean
- Arithmetic-geometric mean/Calculate Pi
- Arithmetic/Complex
- Arithmetic/Integer
- Arithmetic/Rational
- Array concatenation
- Array length
- Arrays
- ASCII art diagram converter
- Assertions
- Associative array/Creation
- Associative array/Iteration
- Associative array/Merging
- Atomic updates
- Attractive numbers
- Average loop length
- Averages/Arithmetic mean
- Averages/Mean angle
- Averages/Mean time of day
- Averages/Median
- Averages/Mode
- Averages/Pythagorean means
- Averages/Root mean square
- Averages/Simple moving average
- AVL tree
B
- Babbage problem
- Balanced brackets
- Balanced ternary
- Banker's algorithm
- Barnsley fern
- Base64 decode data
- Bell numbers
- Benford's law
- Bernoulli numbers
- Best shuffle
- Bin given limits
- Binary digits
- Binary search
- Binary strings
- Bioinformatics/base count
- Bioinformatics/Sequence mutation
- Bitcoin/address validation
- Bitcoin/public point to address
- Bitmap
- Bitmap/Bresenham's line algorithm
- Bitmap/Flood fill
- Bitmap/Histogram
- Bitmap/Read a PPM file
- Bitmap/Write a PPM file
- Bitwise IO
- Bitwise operations
- Boolean values
- Box the compass
- Brace expansion
- Brazilian numbers
- Brilliant numbers
- Brownian tree
- Bulls and cows
- Burrows–Wheeler transform
C
- Caesar cipher
- Calculating the value of e
- Calendar
- Calkin-Wilf sequence
- Call a foreign-language function
- Call a function
- Call a function in a shared library
- Call an object method
- Canonicalize CIDR
- Cantor set
- Carmichael 3 strong pseudoprimes
- Cartesian product of two or more lists
- Case-sensitivity of identifiers
- Casting out nines
- Catalan numbers
- Catalan numbers/Pascal's triangle
- Catamorphism
- Change e letters to i in words
- Chaocipher
- Chaos game
- Character codes
- Chat server
- Check input device is a terminal
- Check output device is a terminal
- Check that file exists
- Checkpoint synchronization
- Cheryl's birthday
- Chinese remainder theorem
- Chinese zodiac
- Cholesky decomposition
- Church numerals
- Circles of given radius through two points
- Circular primes
- Classes
- Closest-pair problem
- Closures/Value capture
- Collections
- Color wheel
- Colour bars/Display
- Combinations
- Combinations with repetitions
- Comma quibbling
- Command-line arguments
- Comments
- Compare a list of strings
- Compare length of two strings
- Compile-time calculation
- Compound data type
- Concurrent computing
- Conditional structures
- Conjugate transpose
- Consecutive primes with ascending or descending differences
- Constrained genericity
- Constrained random points on a circle
- Continued fraction
- Continued fraction/Arithmetic/Construct from rational number
- Convert decimal number to rational
- Convert seconds to compound duration
- Convex hull
- Conway's Game of Life
- Copy a string
- Copy stdin to stdout
- Count in factors
- Count in octal
- Count occurrences of a substring
- Count the coins
- Cramer's rule
- CRC-32
- Create a file
- Create a file on magnetic tape
- Create a two-dimensional array at runtime
- Create an HTML table
- Create an object at a given address
- CSV data manipulation
- CSV to HTML translation
- Cuban primes
- Cullen and Woodall numbers
- Cumulative standard deviation
- Currency
- Currying
- Curzon numbers
- CUSIP
- Cut a rectangle
D
- Damm algorithm
- Date format
- Date manipulation
- Day of the week
- Days between dates
- Deal cards for FreeCell
- Deceptive numbers
- Deepcopy
- Define a primitive data type
- Delegates
- Delete a file
- Department numbers
- Detect division by zero
- Determinant and permanent
- Determine if a string has all the same characters
- Determine if a string has all unique characters
- Determine if a string is collapsible
- Determine if a string is numeric
- Determine if a string is squeezable
- Determine if only one instance is running
- Dice game probabilities
- Digital root
- Dijkstra's algorithm
- Dining philosophers
- Discordian date
- Display a linear combination
- Distribution of 0 digits in factorial series
- DNS query
- Documentation
- Doomsday rule
- Dot product
- Doubly-linked list/Element definition
- Doubly-linked list/Element insertion
- Dragon curve
- Draw a clock
- Draw a pixel
- Draw a sphere
- Dutch national flag problem
E
- Earliest difference between prime gaps
- Echo server
- Egyptian division
- Egyptian fractions
- Element-wise operations
- Elementary cellular automaton
- Elementary cellular automaton/Random Number Generator
- Emirp primes
- Empty directory
- Empty program
- Empty string
- Enforced immutability
- Entropy
- Entropy/Narcissist
- Enumerations
- Environment variables
- Equilibrium index
- Erdös-Selfridge categorization of primes
- Erdős-primes
- Esthetic numbers
- Ethiopian multiplication
- Euler method
- Euler's constant 0.5772...
- Euler's identity
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even or odd
- Events
- Evolutionary algorithm
- Exceptions
- Exceptions/Catch an exception thrown in a nested call
- Execute a Markov algorithm
- Execute a system command
- Execute Brain****
- Execute HQ9+
- Exponentiation operator
- Exponentiation order
- Extend your language
- Extensible prime generator
- Extra primes
- Extract file extension
- Extreme floating point values
F
- Factorial
- Factors of a Mersenne number
- Factors of an integer
- Fairshare between two and more
- Farey sequence
- Fast Fourier transform
- FASTA format
- Fermat numbers
- Fibonacci n-step number sequences
- Fibonacci sequence
- Fibonacci word
- Fibonacci word/fractal
- File extension is in extensions list
- File input/output
- File modification time
- File size
- File size distribution
- Filter
- Find common directory path
- Find duplicate files
- Find limit of recursion
- Find minimum number of coins that make a given value
- Find prime numbers of the form n*n*n+2
- Find the intersection of a line with a plane
- Find the intersection of two lines
- Find the last Sunday of each month
- Find the missing permutation
- First 9 prime Fibonacci number
- First power of 2 that has leading decimal digits of 12
- First-class functions
- First-class functions/Use numbers analogously
- Five weekends
- Fivenum
- Fixed length records
- FizzBuzz
- Flatten a list
- Flipping bits game
- Floyd's triangle
- Floyd-Warshall algorithm
- Forest fire
- Fork
- Formatted numeric output
- Four bit adder
- Four is magic
- Four is the number of letters in the ...
- Fractal tree
- Frobenius numbers
- FTP
- Function composition
- Function definition
- Fusc sequence
G
- Gauss-Jordan matrix inversion
- Gaussian elimination
- General FizzBuzz
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generate random chess position
- Generate random numbers without repeating a value
- Generator/Exponential
- Generic swap
- Get system command output
- Globally replace text in several files
- Go Fish
- Gray code
- Greatest common divisor
- Greatest element of a list
- Greatest subsequential sum
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
H
- Hailstone sequence
- Halt and catch fire
- Hamming numbers
- Handle a signal
- Happy numbers
- Harmonic series
- Harshad or Niven series
- Hash from two arrays
- Hash join
- Haversine formula
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newbie
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Hello world/Web server
- Here document
- Heronian triangles
- Hickerson series of almost integers
- Higher-order functions
- Hilbert curve
- History variables
- Hofstadter Figure-Figure sequences
- Hofstadter Q sequence
- Hofstadter-Conway $10,000 sequence
- Holidays related to Easter
- Horizontal sundial calculations
- Horner's rule for polynomial evaluation
- Host introspection
- Hostname
- Hough transform
- HTTP
- HTTPS
- HTTPS/Authenticated
- HTTPS/Client-authenticated
- Huffman coding
- Hunt the Wumpus
I
- I before E except after C
- IBAN
- Identity matrix
- Idiomatically determine all the lowercase and uppercase letters
- Include a file
- Increasing gaps between consecutive Niven numbers
- Increment a numerical string
- Infinity
- Inheritance/Multiple
- Inheritance/Single
- Input loop
- Integer comparison
- Integer overflow
- Integer roots
- Integer sequence
- Interactive help
- Interactive programming
- Inverted index
- ISBN13 check digit
- Isqrt (integer square root) of X
- Iterated digits squaring
J
K
L
- Langton's ant
- Largest int from concatenated ints
- Last Friday of each month
- Last letter-first letter
- Launch rocket with countdown and acceleration in stdout
- Leap year
- Least common multiple
- Left factorials
- Leonardo numbers
- Letter frequency
- Levenshtein distance
- Levenshtein distance/Alignment
- Line circle intersection
- Linear congruential generator
- List comprehensions
- Literals/Floating point
- Literals/Integer
- Logical operations
- Long primes
- Long year
- Longest common prefix
- Longest common subsequence
- Longest common substring
- Longest increasing subsequence
- Longest string challenge
- Look-and-say sequence
- Loop over multiple arrays simultaneously
- Loops/Break
- Loops/Continue
- Loops/Do-while
- Loops/Downward for
- Loops/For
- Loops/For with a specified step
- Loops/Foreach
- Loops/Infinite
- Loops/N plus one half
- Loops/Nested
- Loops/While
- LU decomposition
- Lucas-Lehmer test
- Ludic numbers
- Luhn test of credit card numbers
- Lychrel numbers
- LZW compression
M
- MAC Vendor Lookup
- Machine code
- Mad Libs
- Magic 8-ball
- Magic squares of doubly even order
- Magic squares of odd order
- Magic squares of singly even order
- Magnanimous numbers
- Main step of GOST 28147-89
- Make directory path
- Man or boy test
- Mandelbrot set
- Map range
- Markov chain text generator
- Mastermind
- Matrix chain multiplication
- Matrix multiplication
- Matrix transposition
- Matrix-exponentiation operator
- Maximum triangle path sum
- Mayan numerals
- Maze generation
- Maze solving
- McNuggets problem
- MD4
- MD5
- MD5/Implementation
- Memory allocation
- Menu
- Metaprogramming
- Metered concurrency
- Middle three digits
- Miller–Rabin primality test
- Mind boggling card trick
- Minesweeper game
- Modular exponentiation
- Modular inverse
- Modulinos
- Monte Carlo methods
- Monty Hall problem
- Morse code
- Motzkin numbers
- Mouse position
- Move-to-front algorithm
- Multi-base primes
- Multifactorial
- Multiple distinct objects
- Multiplication tables
- Munchausen numbers
- Munching squares
- Mutex
- Mutual recursion
N
- N'th
- N-queens problem
- N-smooth numbers
- Naming conventions
- Narcissist
- Narcissistic decimal number
- Negative base numbers
- Nested function
- Next highest int from digits
- Nice primes
- Nim game
- Nimber arithmetic
- Non-decimal radices/Convert
- Non-decimal radices/Input
- Non-decimal radices/Output
- Nonoblock
- Nth root
- Null object
- Number names
- Number reversal game
- Numerical integration
O
P
- P-value correction
- Padovan n-step number sequences
- Padovan sequence
- Palindrome dates
- Palindrome detection
- Palindromic gapful numbers
- Palindromic primes
- Palindromic primes in base 16
- Pangram checker
- Parallel brute force
- Parallel calculations
- Parametric polymorphism
- Parse an IP Address
- Parse command-line arguments
- Parsing/RPN calculator algorithm
- Parsing/Shunting-yard algorithm
- Partition an integer x into n primes
- Partition function P
- Pascal's triangle
- Password generator
- Pattern matching
- Peano curve
- Pell's equation
- Penney's game
- Percentage difference between images
- Perfect numbers
- Perfect shuffle
- Perlin noise
- Permutation test
- Permutations
- Permutations by swapping
- Permutations with repetitions
- Pernicious numbers
- Phrase reversals
- Pi
- Pick random element
- Pig the dice game
- Plasma effect
- Playing cards
- Poker hand analyser
- Population count
- Power set
- Practical numbers
- Price fraction
- Primality by trial division
- Primality by Wilson's theorem
- Prime conspiracy
- Prime decomposition
- Prime triangle
- Prime words
- Primorial numbers
- Priority queue
- Probabilistic choice
- Program name
- Program termination
- Proper divisors
- Pythagoras tree
- Pythagorean quadruples
- Pythagorean triples
R
- Ramer-Douglas-Peucker line simplification
- Random number generator (device)
- Random number generator (included)
- Random numbers
- Range consolidation
- Range expansion
- Range extraction
- Rare numbers
- Raster bars
- Ray-casting algorithm
- RCRPG
- Read a configuration file
- Read a file character by character/UTF8
- Read a file line by line
- Read a specific line from a file
- Read entire file
- Real constants and functions
- Reduced row echelon form
- Regular expressions
- Remove duplicate elements
- Remove lines from a file
- Remove vowels from a string
- Rename a file
- Rep-string
- Repeat
- Repeat a string
- Return multiple values
- Reverse a string
- Reverse words in a string
- Rhonda numbers
- RIPEMD-160
- Rock-paper-scissors
- Roman numerals/Decode
- Roman numerals/Encode
- Roots of a function
- Roots of unity
- Rosetta Code/Count examples
- Rosetta Code/Find bare lang tags
- Rosetta Code/Find unimplemented tasks
- Rosetta Code/Fix code tags
- Rot-13
- RPG attributes generator
- RSA code
- Run-length encoding
- Runge-Kutta method
S
- S-expressions
- Safe mode
- Safe primes and unsafe primes
- Search a list
- Search a list of records
- Secure temporary file
- SEDOLs
- Self-describing numbers
- Self-hosting compiler
- Semiprime
- Semordnilap
- Sequence of non-squares
- Sequence of primes by trial division
- Sequence: smallest number with exactly n divisors
- Set
- Set of real numbers
- Set puzzle
- Set right-adjacent bits
- Sexy primes
- SHA-1
- SHA-256
- SHA-256 Merkle tree
- Shell one-liner
- Shift list elements to left by 3
- Short-circuit evaluation
- Show ASCII table
- Show the epoch
- Sierpinski arrowhead curve
- Sierpinski carpet
- Sierpinski curve
- Sierpinski pentagon
- Sierpinski square curve
- Sierpinski triangle
- Sierpinski triangle/Graphical
- Sieve of Eratosthenes
- Simple windowed application
- Simulate input/Keyboard
- Simulate input/Mouse
- Singly-linked list/Element definition
- Singly-linked list/Element insertion
- Singly-linked list/Traversal
- Sleep
- Smarandache prime-digital sequence
- Smith numbers
- Snake
- Sockets
- Solve a Hidato puzzle
- Sort a list of object identifiers
- Sort an array of composite structures
- Sort an integer array
- Sort disjoint sublist
- Sort numbers lexicographically
- Sort stability
- Sort three variables
- Sort using a custom comparator
- Sorting algorithms/Bogosort
- Sorting algorithms/Bubble sort
- Sorting Algorithms/Circle Sort
- Sorting algorithms/Cocktail sort
- Sorting algorithms/Cocktail sort with shifting bounds
- Sorting algorithms/Comb sort
- Sorting algorithms/Counting sort
- Sorting algorithms/Gnome sort
- Sorting algorithms/Heapsort
- Sorting algorithms/Insertion sort
- Sorting algorithms/Merge sort
- Sorting algorithms/Pancake sort
- Sorting algorithms/Quicksort
- Sorting algorithms/Radix sort
- Sorting algorithms/Selection sort
- Sorting algorithms/Shell sort
- Sorting algorithms/Sleep sort
- Sorting algorithms/Stooge sort
- Sparkline in unicode
- Spelling of ordinal numbers
- Spinning rod animation/Text
- Spiral matrix
- Split a character string based on change of character
- Square but not cube
- Square-free integers
- Stack
- Stair-climbing puzzle
- Statistics/Basic
- Statistics/Normal distribution
- Strange unique prime triplets
- String append
- String case
- String comparison
- String concatenation
- String interpolation (included)
- String length
- String matching
- String prepend
- Strip a set of characters from a string
- Strip comments from a string
- Strip whitespace from a string/Top and tail
- Strong and weak primes
- Substring
- Substring/Top and tail
- Subtractive generator
- Successive prime differences
- Sudoku
- Sum and product of an array
- Sum data type
- Sum digits of an integer
- Sum multiples of 3 and 5
- Sum of a series
- Sum of first n cubes
- Sum of squares
- Summarize primes
- Super-d numbers
- Sutherland-Hodgman polygon clipping
- Symmetric difference
- Synchronous concurrency
- System time
T
- Take notes on the command line
- Tarjan
- Tau function
- Tau number
- Taxicab numbers
- Teacup rim text
- Temperature conversion
- Terminal control/Clear the screen
- Terminal control/Coloured text
- Terminal control/Preserve screen
- Terminal control/Ringing the terminal bell
- Ternary logic
- Test a function
- Text between
- Text processing/Max licenses in use
- Textonyms
- The ISAAC Cipher
- The Twelve Days of Christmas
- Thiele's interpolation formula
- Thue-Morse
- Tic-tac-toe
- Time a function
- Tokenize a string
- Tokenize a string with escaping
- Top rank per group
- Topological sort
- Topswops
- Totient function
- Towers of Hanoi
- Trabb Pardo–Knuth algorithm
- Tree traversal
- Trigonometric functions
- Truncatable primes
- Truncate a file
- Truth table
- Twin primes
- Two sum
- Type detection
U
- Ulam numbers
- Ulam spiral (for primes)
- Unbias a random generator
- Undefined values
- Unicode strings
- Unicode variable names
- Universal Turing machine
- Unix/ls
- Unprimeable numbers
- Untrusted environment
- URL decoding
- URL encoding
- URL parser
- Use another language to call a function
- User input/Text
- UTF-8 encode and decode
V
W
Categories:
- Implementations
- Rust Implementations
- Rust related
- Execution method/Compiled/Machine code
- Garbage collection/Allowed
- Typing/Safe
- Typing/Strong
- Typing/Compatibility/Nominative
- Typing/Expression/Implicit
- Typing/Checking/Static
- Programming Languages
- Programming paradigm/Functional
- Programming paradigm/Imperative
- Programming paradigm/Object-oriented
- Programming paradigm/Generic