코딩Coding/Rust용어
-
Rust용어)연관 함수(Associated function)코딩Coding/Rust용어 2020. 10. 3. 18:00
연관 함수는 특정한 인스턴스가 아니라 타입(예제에서는 String) 자체에 구현된 함수다. 다른 언어는 이런 메소드를 정적 메서드(static method)라고 부르기도 한다. http://m.yes24.com/Goods/Detail/90454264러스트 프로그래밍 공식 가이드러스트 핵심 멤버 2인이 집필하고 RUST 2018이 반영된 국내 첫 러스트 공식 문서! 사람에게 더 친숙한 고수준의 프로그래밍과 저수준의 제어는 프로그래밍 언어 디자인에서 서로 m.yes24.com
-
Rust용어_impl Trait for returning complex type with ease.코딩Coding/Rust용어 2020. 9. 20. 11:49
https://doc.rust-lang.org/edition-guide/rust-2018/trait-system/impl-trait-for-returning-complex-types-with-ease.htmlimpl Trait for returning complex types with ease - The Edition Guideimpl Trait is the new way to specify unnamed but concrete types that implement a specific trait. There are two places you can put it: argument position, and return position. trait Trait {} // argument position fn f..
-
Rust용어_dyn Trait for trait objects- The Edition Guide코딩Coding/Rust용어 2020. 9. 20. 11:41
https://doc.rust-lang.org/edition-guide/rust-2018/trait-system/dyn-trait-for-trait-objects.htmldyn Trait for trait objects - The Edition GuideThe dyn Trait feature is the new syntax for using trait objects. In short: Box becomes Box &Trait and &mut Trait become &dyn Trait and &mut dyn Trait And so on. In code: #![allow(unused)] fn main() { trait Trait {} impl Trait for i32 {} // old fn function1..
-
Rust용어)Non-lexical lifetimes코딩Coding/Rust용어 2020. 9. 20. 10:15
https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/non-lexical-lifetimes.htmlNon-lexical lifetimes - The Edition Guidefor 2018 edition for 2015 edition The borrow checker has been enhanced to accept more code, via a mechanism called "non-lexical lifetimes." Consider this example: fn main() { let mut x = 5; let y = &x; let z = &mut x; } In older Rust, this is a compile-timd..
-
Rust용어)Default match binding코딩Coding/Rust용어 2020. 9. 20. 10:14
https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/default-match-bindings.htmlDefault match bindings - The Edition GuideHave you ever had a borrowed Option and tried to match on it? You probably wrote this: let s: &Option = &Some("hello".to_string()); match s { Some(s) => println!("s is: {}", s), _ => (), }; In Rust 2015, this would fail to compile, and you would have to w..
-
(Rust용어) inference 추론처리코딩Coding/Rust용어 2020. 9. 20. 10:10
https://100.daum.net/encyclopedia/view/156XX52207610추론처리컴퓨터의 지식정보 처리 중의 중요한 측면의 하나. 유연성이 요구되는 지적인 정보처리 시스템은 종래의 절차형으로 기술하려면 처리가 방대해지고 복잡해져서 기술이 곤란하게 된다. 그러므100.daum.net Inference -Rust By Example https://doc.rust-lang.org/stable/rust-by-example/types/inference.htmlInference - Rust By ExampleThe type inference engine is pretty smart. It does more than looking at the type of the value expression d..