Project: Temperature Class
Write a mutable class to represent thermodynamic temperature. The internal representation should be in Celcius but there should be setters and getters for all four temperature scales: Celcius, Fahrenheit, Kelvin and Rankine. A single default constructor should set the temperature to 0°K.
See [[Temperature]]
Output
$ rustc TemperatureClass.rs
error: unknown format trait `f`
--> TemperatureClass.rs:65:40
|
65 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:66:39
|
66 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:67:43
|
67 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:68:40
|
68 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:72:40
|
72 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:73:39
|
73 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:74:43
|
74 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:75:40
|
75 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:79:40
|
79 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:80:39
|
80 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:81:43
|
81 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:82:40
|
82 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:86:40
|
86 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:87:39
|
87 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:88:43
|
88 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:89:40
|
89 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:93:40
|
93 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:94:39
|
94 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:95:43
|
95 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error: unknown format trait `f`
--> TemperatureClass.rs:96:40
|
96 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| ^
|
= note: the only appropriate formatting traits are:
- ``, which uses the `Display` trait
- `?`, which uses the `Debug` trait
- `e`, which uses the `LowerExp` trait
- `E`, which uses the `UpperExp` trait
- `o`, which uses the `Octal` trait
- `p`, which uses the `Pointer` trait
- `b`, which uses the `Binary` trait
- `x`, which uses the `LowerHex` trait
- `X`, which uses the `UpperHex` trait
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:34:3
|
33 | fn new() -> Temperature {
| --- this function doesn't have a `self` parameter
34 | self.temperatureInCelsius = -self.CELSIUS_TO_KELVIN;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
33 | fn new(&self) -> Temperature {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:34:32
|
33 | fn new() -> Temperature {
| --- this function doesn't have a `self` parameter
34 | self.temperatureInCelsius = -self.CELSIUS_TO_KELVIN;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
33 | fn new(&self) -> Temperature {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:37:10
|
36 | fn getCelsius() -> f64 {
| ---------- this function doesn't have a `self` parameter
37 | return self.temperatureInCelsius;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
36 | fn getCelsius(&self) -> f64 {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:40:35
|
39 | fn setCelsius(temperatureInCelsius:f64) -> () {
| ---------- this function doesn't have a `self` parameter
40 | assert!(temperatureInCelsius > -self.CELSIUS_TO_KELVIN, "temperatureInCelsius > -self.CELSIUS_TO_KELVIN");
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
39 | fn setCelsius(&self, temperatureInCelsius:f64) -> () {
| ++++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:41:3
|
39 | fn setCelsius(temperatureInCelsius:f64) -> () {
| ---------- this function doesn't have a `self` parameter
40 | assert!(temperatureInCelsius > -self.CELSIUS_TO_KELVIN, "temperatureInCelsius > -self.CELSIUS_TO_KELVIN");
41 | self.temperatureInCelsius = temperatureInCelsius;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
39 | fn setCelsius(&self, temperatureInCelsius:f64) -> () {
| ++++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:44:10
|
43 | fn getKelvin() -> f64 {
| --------- this function doesn't have a `self` parameter
44 | return self.getCelsius() + self.CELSIUS_TO_KELVIN;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
43 | fn getKelvin(&self) -> f64 {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:44:30
|
43 | fn getKelvin() -> f64 {
| --------- this function doesn't have a `self` parameter
44 | return self.getCelsius() + self.CELSIUS_TO_KELVIN;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
43 | fn getKelvin(&self) -> f64 {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:47:3
|
46 | fn setKelvin(k:f64) -> () {
| --------- this function doesn't have a `self` parameter
47 | self.setCelsius(k - Temperature::CELSIUS_TO_KELVIN);
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
46 | fn setKelvin(&self, k:f64) -> () {
| ++++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:50:10
|
49 | fn getRankine() -> f64 {
| ---------- this function doesn't have a `self` parameter
50 | return self.getKelvin() * KELVIN_TO_RANKINE;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
49 | fn getRankine(&self) -> f64 {
| +++++
error[E0425]: cannot find value `KELVIN_TO_RANKINE` in this scope
--> TemperatureClass.rs:50:29
|
50 | return self.getKelvin() * KELVIN_TO_RANKINE;
| ^^^^^^^^^^^^^^^^^ a field by this name exists in `Self`
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:53:3
|
52 | fn setRankine(r:f64) -> () {
| ---------- this function doesn't have a `self` parameter
53 | self.setKelvin(r / self.KELVIN_TO_RANKINE);
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
52 | fn setRankine(&self, r:f64) -> () {
| ++++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:53:22
|
52 | fn setRankine(r:f64) -> () {
| ---------- this function doesn't have a `self` parameter
53 | self.setKelvin(r / self.KELVIN_TO_RANKINE);
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
52 | fn setRankine(&self, r:f64) -> () {
| ++++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:56:10
|
55 | fn getFahrenheit() -> f64 {
| ------------- this function doesn't have a `self` parameter
56 | return self.getRankine() - self.FAHRENHEIT_TO_RANKINE;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
55 | fn getFahrenheit(&self) -> f64 {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:56:30
|
55 | fn getFahrenheit() -> f64 {
| ------------- this function doesn't have a `self` parameter
56 | return self.getRankine() - self.FAHRENHEIT_TO_RANKINE;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
55 | fn getFahrenheit(&self) -> f64 {
| +++++
error[E0424]: expected value, found module `self`
--> TemperatureClass.rs:59:3
|
58 | fn setFahrenheit(f:f64) -> () {
| ------------- this function doesn't have a `self` parameter
59 | self.setRankine(f + FAHRENHEIT_TO_RANKINE);
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
58 | fn setFahrenheit(&self, f:f64) -> () {
| ++++++
error[E0425]: cannot find value `FAHRENHEIT_TO_RANKINE` in this scope
--> TemperatureClass.rs:59:23
|
59 | self.setRankine(f + FAHRENHEIT_TO_RANKINE);
| ^^^^^^^^^^^^^^^^^^^^^ a field by this name exists in `Self`
error[E0308]: mismatched types
--> TemperatureClass.rs:33:14
|
33 | fn new() -> Temperature {
| --- ^^^^^^^^^^^ expected `Temperature`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
error[E0599]: no associated item named `CELSIUS_TO_KELVIN` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:47:36
|
7 | struct Temperature {
| ------------------ associated item `CELSIUS_TO_KELVIN` not found for this struct
...
47 | self.setCelsius(k - Temperature::CELSIUS_TO_KELVIN);
| ^^^^^^^^^^^^^^^^^ associated item not found in `Temperature`
error[E0599]: no method named `getCelsius` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:65:47
|
7 | struct Temperature {
| ------------------ method `getCelsius` not found for this struct
...
65 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getCelsius()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:36:2
|
36 | fn getCelsius() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getKelvin` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:66:46
|
7 | struct Temperature {
| ------------------ method `getKelvin` not found for this struct
...
66 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| --^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getKelvin()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:43:2
|
43 | fn getKelvin() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getFahrenheit` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:67:50
|
7 | struct Temperature {
| ------------------ method `getFahrenheit` not found for this struct
...
67 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| --^^^^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getFahrenheit()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:55:2
|
55 | fn getFahrenheit() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getRankine` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:68:47
|
7 | struct Temperature {
| ------------------ method `getRankine` not found for this struct
...
68 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getRankine()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:49:2
|
49 | fn getRankine() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `setCelsius` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:71:4
|
7 | struct Temperature {
| ------------------ method `setCelsius` not found for this struct
...
71 | t.setCelsius(100.f64);
| --^^^^^^^^^^---------
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::setCelsius(t, 100.f64)`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:39:2
|
39 | fn setCelsius(temperatureInCelsius:f64) -> () {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> TemperatureClass.rs:71:19
|
71 | t.setCelsius(100.f64);
| ^^^
|
help: if intended to be a floating point literal, consider adding a `0` after the period
|
71 | t.setCelsius(100.0f64);
| +
error[E0599]: no method named `getCelsius` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:72:47
|
7 | struct Temperature {
| ------------------ method `getCelsius` not found for this struct
...
72 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getCelsius()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:36:2
|
36 | fn getCelsius() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getKelvin` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:73:46
|
7 | struct Temperature {
| ------------------ method `getKelvin` not found for this struct
...
73 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| --^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getKelvin()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:43:2
|
43 | fn getKelvin() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getFahrenheit` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:74:50
|
7 | struct Temperature {
| ------------------ method `getFahrenheit` not found for this struct
...
74 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| --^^^^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getFahrenheit()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:55:2
|
55 | fn getFahrenheit() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getRankine` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:75:47
|
7 | struct Temperature {
| ------------------ method `getRankine` not found for this struct
...
75 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getRankine()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:49:2
|
49 | fn getRankine() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `setFahrenheit` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:78:4
|
7 | struct Temperature {
| ------------------ method `setFahrenheit` not found for this struct
...
78 | t.setFahrenheit(-40.f64);
| --^^^^^^^^^^^^^---------
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::setFahrenheit(t, -40.f64)`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:58:2
|
58 | fn setFahrenheit(f:f64) -> () {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> TemperatureClass.rs:78:22
|
78 | t.setFahrenheit(-40.f64);
| ^^^
|
help: if intended to be a floating point literal, consider adding a `0` after the period
|
78 | t.setFahrenheit(-40.0f64);
| +
error[E0599]: no method named `getCelsius` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:79:47
|
7 | struct Temperature {
| ------------------ method `getCelsius` not found for this struct
...
79 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getCelsius()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:36:2
|
36 | fn getCelsius() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getKelvin` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:80:46
|
7 | struct Temperature {
| ------------------ method `getKelvin` not found for this struct
...
80 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| --^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getKelvin()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:43:2
|
43 | fn getKelvin() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getFahrenheit` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:81:50
|
7 | struct Temperature {
| ------------------ method `getFahrenheit` not found for this struct
...
81 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| --^^^^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getFahrenheit()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:55:2
|
55 | fn getFahrenheit() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getRankine` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:82:47
|
7 | struct Temperature {
| ------------------ method `getRankine` not found for this struct
...
82 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getRankine()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:49:2
|
49 | fn getRankine() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `setKelvin` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:85:4
|
7 | struct Temperature {
| ------------------ method `setKelvin` not found for this struct
...
85 | t.setKelvin(373.15f64);
| --^^^^^^^^^-----------
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::setKelvin(t, 373.15f64)`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:46:2
|
46 | fn setKelvin(k:f64) -> () {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getCelsius` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:86:47
|
7 | struct Temperature {
| ------------------ method `getCelsius` not found for this struct
...
86 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getCelsius()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:36:2
|
36 | fn getCelsius() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getKelvin` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:87:46
|
7 | struct Temperature {
| ------------------ method `getKelvin` not found for this struct
...
87 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| --^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getKelvin()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:43:2
|
43 | fn getKelvin() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getFahrenheit` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:88:50
|
7 | struct Temperature {
| ------------------ method `getFahrenheit` not found for this struct
...
88 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| --^^^^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getFahrenheit()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:55:2
|
55 | fn getFahrenheit() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getRankine` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:89:47
|
7 | struct Temperature {
| ------------------ method `getRankine` not found for this struct
...
89 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getRankine()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:49:2
|
49 | fn getRankine() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `setRankine` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:92:4
|
7 | struct Temperature {
| ------------------ method `setRankine` not found for this struct
...
92 | t.setRankine(671.67f64);
| --^^^^^^^^^^-----------
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::setRankine(t, 671.67f64)`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:52:2
|
52 | fn setRankine(r:f64) -> () {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getCelsius` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:93:47
|
7 | struct Temperature {
| ------------------ method `getCelsius` not found for this struct
...
93 | println!("{}", format!("Celcius: {0:.2f}", t.getCelsius()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getCelsius()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:36:2
|
36 | fn getCelsius() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getKelvin` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:94:46
|
7 | struct Temperature {
| ------------------ method `getKelvin` not found for this struct
...
94 | println!("{}", format!("Kelvin: {0:.2f}", t.getKelvin()));
| --^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getKelvin()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:43:2
|
43 | fn getKelvin() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getFahrenheit` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:95:50
|
7 | struct Temperature {
| ------------------ method `getFahrenheit` not found for this struct
...
95 | println!("{}", format!("Fahrenheit: {0:.2f}", t.getFahrenheit()));
| --^^^^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getFahrenheit()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:55:2
|
55 | fn getFahrenheit() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0599]: no method named `getRankine` found for struct `Temperature` in the current scope
--> TemperatureClass.rs:96:47
|
7 | struct Temperature {
| ------------------ method `getRankine` not found for this struct
...
96 | println!("{}", format!("Rankine: {0:.2f}", t.getRankine()));
| --^^^^^^^^^^--
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Temperature::getRankine()`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `Temperature`
--> TemperatureClass.rs:49:2
|
49 | fn getRankine() -> f64 {
| ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 64 previous errors
Some errors have detailed explanations: E0308, E0424, E0425, E0599, E0610.
For more information about an error, try `rustc --explain E0308`.