Comprehensive Rust(Español) 202412visto cada valor de tipo T. struct Counter { values: HashMap, } impl Counter { /// Crea un nuevo Counter. fn new() -> Self { Counter { values: HashMap::new(), } } /// Cuenta una repetición valor dado. fn count(&mut self, value: u32) { if self.values.contains_key(&value) { *self.values.get_mut(&value).unwrap() += 1; } else { self.values.insert(value, 1); } } /// Devuelve el número de veces veces que se ha visto el valor dado. fn times_seen(&self, value: u32) -> u64 { self.values.get(&value).copied().unwrap_or_default() } } fn main() { let mut ctr = Counter::new(); ctr.count(13); ctr 0 码力 | 389 页 | 1.04 MB | 11 月前3
PlantUML 1.2019.4 Guía de Referencia del Lenguajealignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value PlantUML (1.2019.4) 145 / 165 19.8 Default values for macro parameters 19 PREPROCESSING 19.8 Default values for macro parameters It is possible to assign default values to macro parameters. @startuml !define . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 19.8 Default values for macro parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Guía0 码力 | 166 页 | 1.82 MB | 1 年前3
PlantUML 1.2019.3 Guía de Referencia del Lenguajealignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value PlantUML (1.2019.3) 138 / 157 17.8 Default values for macro parameters 17 PREPROCESSING 17.8 Default values for macro parameters It is possible to assign default values to macro parameters. @startuml !define . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 17.8 Default values for macro parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 17.9 Conditions0 码力 | 158 页 | 1.72 MB | 1 年前3
PlantUML 1.2019.2 Guía de Referencia del Lenguajealignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value PlantUML (1.2019.2) 138 / 157 17.8 Default values for macro parameters 17 PREPROCESSING 17.8 Default values for macro parameters It is possible to assign default values to macro parameters. @startuml !define . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 17.8 Default values for macro parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 17.9 Conditions0 码力 | 158 页 | 1.72 MB | 1 年前3
PlantUML 1.2019.1 Guía de Referencia del Lenguajealignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value -> x : ok !enddefinelong AUTHEN(Bob,Alice) @enduml 17.8 Default values for macro parameters It is possible to assign default values to macro parameters. @startuml !define some_macro(x, y = "some default" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 17.8 Default values for macro parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 17.9 Conditions0 码力 | 147 页 | 1.85 MB | 1 年前3
PlantUML 1.2023.11 Guía de Referencia del Lenguajehow you want them to be drawn. Keyword Description analog An analog signal is continuous, and the values are linearly interpolated between the given setpoints binary A binary signal restricted to only text in a textarea . " " } @endsalt 14.3 Open, close droplist You can open a droplist, by adding values enclosed by ^, as: @startsalt { ^This is a closed droplist^ | ^This is an open droplist^^ item 1^^ project, with one of those parameters: • printscale • ganttscale • projectscale and one of the values: • daily (by default) • weekly • monthly Guía de Referencia del Lenguaje PlantUML (1.2023.11)0 码力 | 531 页 | 7.53 MB | 1 年前3
PlantUML 1.2020.23 Guía de Referencia del Lenguajeproject, with one of those parameters: • printscale • ganttscale • projectscale and one of the values: • daily (by default) • weekly • monthly (See QA-11272, QA-9041 and QA-10948) 10.11.1 Daily alignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value @enduml 20.8 Default argument value In both procedure and return functions, you can define default values for arguments. Guía de Referencia del Lenguaje PlantUML (1.2020.23) 273 / 304 20.9 Unquoted procedure0 码力 | 305 页 | 3.11 MB | 1 年前3
PlantUML 1.2020.22 Guía de Referencia del Lenguajeproject, with one of those parameters: • printscale • ganttscale • projectscale and one of the values: • daily (by default) • weekly • monthly (See QA-11272, QA-9041 and QA-10948) 10.11.1 Daily alignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value @enduml 20.8 Default argument value In both procedure and return functions, you can define default values for arguments. Guía de Referencia del Lenguaje PlantUML (1.2020.22) 261 / 292 20.9 Unquoted procedure0 码力 | 293 页 | 3.02 MB | 1 年前3
PlantUML 1.2019.9 Guía de Referencia del Lenguajealignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value $ijk @enduml 19.6 Default argument value In both return and void functions, you can define default values for arguments. @startuml !function $inc($value, $step=1) !return $value + $step !endfunction Alice two to three : $inc(3, 2) @enduml Only arguments at the end of the parameter list can have default values. @startuml !function defaulttest($x, $y="DefaultY", $z="DefaultZ") note over Alice x = $x y = $y0 码力 | 172 页 | 1.93 MB | 1 年前3
PlantUML 1.2021.2 Guía de Referencia del Lenguajeproject, with one of those parameters: • printscale • ganttscale • projectscale and one of the values: • daily (by default) • weekly • monthly (See QA-11272, QA-9041 and QA-10948) Guía de Referencia alignment can be set up to left, right or center. You can also use direction or reverseDirection values for sequenceMessageAlign which align text depending on arrow direction. Param name Default value @enduml 25.8 Default argument value In both procedure and return functions, you can define default values for arguments. @startuml !function $inc($value, $step=1) !return $value + $step !endfunction Alice0 码力 | 389 页 | 4.12 MB | 1 年前3
共 15 条
- 1
- 2













