2020-11-13から1日間の記事一覧

day 37 @go 構造体のフィールドにアクセス

ドットでアクセスする。myStruct.value

day 36 @go struct

定義方法 type MyStruct struct { first_field int second_field *int }

day 36 @rust trait①

・traitの定義とtraitの実装方法 trait MyTrait { fn shared_function(&self); } impl MyTrait for MyStruct { fn shared_function(&self) { // do something } } ・メソッドのデフォルト動作を決めておく trait MyTrait { fn shared_function(&self) { prin…