Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/fadeevab/design-patterns-rust
/ functions
Functions
277 in github.com/fadeevab/design-patterns-rust
⨍
Functions
277
◇
Types & classes
119
↓ 13 callers
Method
device
(&mut self)
structural/bridge/remotes/basic.rs:16
↓ 6 callers
Method
add
(&mut self, component: impl Component + 'static)
structural/composite/fs/folder.rs:16
↓ 6 callers
Method
iter
Returns an iterator over a user collection. The method name may be different, however, `iter` is used as a de facto standard in a Rust naming convent
behavioral/iterator/users.rs:18
↓ 6 callers
Method
route
(&self, from: &str, to: &str)
behavioral/strategy/functional.rs:23
↓ 5 callers
Method
create_button
(&self)
creational/abstract-factory/macos-gui/factory.rs:11
↓ 5 callers
Method
handle_request
(&mut self, url: &str, method: &str)
structural/proxy/server/nginx.rs:34
↓ 5 callers
Method
press
(&self)
creational/abstract-factory/macos-gui/button.rs:6
↓ 4 callers
Method
check
(&self, name: &String)
structural/facade/account.rs:10
↓ 4 callers
Method
create_checkbox
(&self)
creational/abstract-factory/macos-gui/factory.rs:15
↓ 4 callers
Function
execute
(s: &mut Cursive, button: &'static str)
behavioral/state/main.rs:41
↓ 4 callers
Method
pause
(&mut self)
behavioral/state/player.rs:53
↓ 4 callers
Method
route
(&self, from: &str, to: &str)
behavioral/strategy/conceptual.rs:34
↓ 4 callers
Method
switch
(&self)
creational/abstract-factory/macos-gui/checkbox.rs:6
↓ 3 callers
Method
arrive
(&self)
behavioral/mediator/mediator-rc-refcell/trains/freight_train.rs:22
↓ 3 callers
Method
depart
(&mut self, name: &'static str)
behavioral/mediator/mediator-top-down/train_station.rs:55
↓ 3 callers
Function
do_a_call
()
creational/singleton/how-to-create/mutex.rs:14
↓ 3 callers
Function
do_a_call
()
creational/singleton/how-to-create/lazy.rs:19
↓ 3 callers
Function
do_a_call
()
creational/singleton/how-to-create/once.rs:15
↓ 3 callers
Method
events
(&mut self)
behavioral/observer/editor.rs:12
↓ 3 callers
Function
execute
Executes a command and then pushes it to a history array.
behavioral/command/main.rs:37
↓ 3 callers
Function
into_next
Helps to wrap an object into a boxed type.
behavioral/chain-of-responsibility/department.rs:31
↓ 3 callers
Function
log
(level: Level, message: &str)
creational/singleton/logger/log.rs:30
↓ 3 callers
Method
name
(&self)
behavioral/mediator/mediator-rc-refcell/trains/freight_train.rs:18
↓ 3 callers
Method
set_car_type
(&mut self, car_type: CarType)
creational/builder/builders/car.rs:22
↓ 3 callers
Method
set_engine
(&mut self, engine: Engine)
creational/builder/builders/car.rs:26
↓ 3 callers
Method
set_gsp_navigator
(&mut self, gps_navigator: GpsNavigator)
creational/builder/builders/car.rs:30
↓ 3 callers
Method
set_seats
(&mut self, seats: u16)
creational/builder/builders/car.rs:34
↓ 3 callers
Method
set_transmission
(&mut self, transmission: Transmission)
creational/builder/builders/car.rs:38
↓ 3 callers
Method
set_volume
(&mut self, percent: u8)
structural/bridge/device/tv.rs:37
↓ 3 callers
Method
track_mut
(&mut self)
behavioral/state/player.rs:65
↓ 2 callers
Method
accept
(&mut self, mut train: impl Train + 'static)
behavioral/mediator/mediator-top-down/train_station.rs:45
↓ 2 callers
Method
arrive
(&mut self, mediator: &mut dyn Mediator)
behavioral/mediator/mediator-top-down/trains/freight_train.rs:19
↓ 2 callers
Method
build
(self)
creational/builder/builders/car.rs:42
↓ 2 callers
Function
call
Calls any object of a `Target` trait. To understand the Adapter pattern better, imagine that this is a client code, which can operate over a specific
structural/adapter/main.rs:15
↓ 2 callers
Method
channel
(&self)
structural/bridge/device/tv.rs:41
↓ 2 callers
Function
client_code
(concrete: impl TemplateMethod)
behavioral/template-method/main.rs:55
↓ 2 callers
Method
depart
(&self)
behavioral/mediator/mediator-rc-refcell/trains/freight_train.rs:31
↓ 2 callers
Method
execute
(&mut self, patient: &mut Patient)
behavioral/chain-of-responsibility/department.rs:18
↓ 2 callers
Function
info
(message: &str)
creational/singleton/logger/log.rs:46
↓ 2 callers
Method
load
(&mut self, path: String)
behavioral/observer/editor.rs:16
↓ 2 callers
Method
make_entry
(&mut self, account_id: &String, txn_type: String, amount: u32)
structural/facade/ledger.rs:4
↓ 2 callers
Method
name
(&self)
behavioral/mediator/mediator-top-down/trains/freight_train.rs:15
↓ 2 callers
Method
notify
(&self, event_type: Event, file_path: String)
behavioral/observer/observer.rs:32
↓ 2 callers
Method
notify_about_arrival
(&self, train: &dyn Train)
behavioral/mediator/mediator-rc-refcell/train_station.rs:28
↓ 2 callers
Method
notify_about_arrival
(&mut self, train_name: &str)
behavioral/mediator/mediator-top-down/train_station.rs:19
↓ 2 callers
Method
notify_about_departure
(&self, train: &dyn Train)
behavioral/mediator/mediator-rc-refcell/train_station.rs:42
↓ 2 callers
Method
notify_about_departure
(&mut self, train_name: &str)
behavioral/mediator/mediator-top-down/train_station.rs:29
↓ 2 callers
Method
parse_vec
(&self, input: Vec<i32>)
behavioral/visitor/main.rs:69
↓ 2 callers
Method
plant_tree
(&mut self, x: u32, y: u32, color: TreeColor, name: String, data: String)
structural/flyweight/forest.rs:28
↓ 2 callers
Method
power
(&mut self)
structural/bridge/remotes/mod.rs:14
↓ 2 callers
Method
print_status
(&self)
structural/bridge/device/tv.rs:49
↓ 2 callers
Method
register
(&mut self, train: Rc<dyn Train>)
behavioral/mediator/mediator-rc-refcell/train_station.rs:22
↓ 2 callers
Function
render
Renders GUI. Factory object must be passed as a parameter to such the generic function with factory invocation to utilize static dispatch.
creational/abstract-factory/app/render.rs:8
↓ 2 callers
Function
render_dialog
(random_number: f64)
creational/simple-factory/main.rs:14
↓ 2 callers
Method
restore
(self)
behavioral/memento/conceptual.rs:23
↓ 2 callers
Method
rewind
(&mut self)
behavioral/state/player.rs:57
↓ 2 callers
Method
rgb
(&self)
structural/flyweight/forest/tree.rs:13
↓ 2 callers
Function
run
The client code initializes resources and does other preparations then it uses a factory to construct and run the game.
creational/factory-method/maze-game/game.rs:22
↓ 2 callers
Method
save
Serializes an originator into a string of JSON format.
behavioral/memento/serde.rs:13
↓ 2 callers
Method
save
(&self)
behavioral/memento/conceptual.rs:11
↓ 2 callers
Method
save
(&self)
behavioral/observer/editor.rs:21
↓ 2 callers
Method
set_channel
(&mut self, channel: u16)
structural/bridge/device/tv.rs:45
↓ 2 callers
Method
subscribe
(&mut self, event_type: Event, listener: Subscriber)
behavioral/observer/observer.rs:20
↓ 2 callers
Function
test_device
(device: impl Device + Clone)
structural/bridge/main.rs:13
↓ 2 callers
Method
visit_vec
(&self, v: Vec<i32>)
behavioral/visitor/visitor.rs:18
↓ 2 callers
Method
volume
(&self)
structural/bridge/device/tv.rs:33
↓ 1 callers
Method
add_money_to_wallet
( &mut self, account_id: &String, security_code: u32, amount: u32, )
structural/facade/wallet_facade.rs:31
↓ 1 callers
Method
base_operation1
(&self)
behavioral/template-method/main.rs:12
↓ 1 callers
Method
base_operation2
(&self)
behavioral/template-method/main.rs:16
↓ 1 callers
Method
base_operation3
(&self)
behavioral/template-method/main.rs:20
↓ 1 callers
Method
build_route
(&self, from: &str, to: &str)
behavioral/strategy/conceptual.rs:9
↓ 1 callers
Function
change
A pure safe way to implement Singleton in Rust is using no static variables and passing everything around through function arguments. The oldest livin
creational/singleton/how-to-create/local.rs:5
↓ 1 callers
Method
check_rate_limiting
(&mut self, url: &str)
structural/proxy/server/nginx.rs:21
↓ 1 callers
Function
create_button
Creates a button depending on a parameter value, it is the simple factory.
creational/simple-factory/main.rs:6
↓ 1 callers
Method
create_button
Creates an HTML button.
creational/factory-method/render-dialog/html_gui.rs:20
↓ 1 callers
Method
credit_balance
(&mut self, amount: u32)
structural/facade/wallet.rs:10
↓ 1 callers
Method
debit_balance
(&mut self, amount: u32)
structural/facade/wallet.rs:14
↓ 1 callers
Method
deduct_money_from_wallet
( &mut self, account_id: &String, security_code: u32, amount: u32, )
structural/facade/wallet_facade.rs:46
↓ 1 callers
Method
disable
(&mut self)
structural/bridge/device/tv.rs:29
↓ 1 callers
Method
draw
(&self, canvas: &mut Canvas)
structural/flyweight/forest.rs:41
↓ 1 callers
Method
enable
(&mut self)
structural/bridge/device/tv.rs:25
↓ 1 callers
Method
enabled
(&self, level: &Level)
creational/singleton/logger/simple_logger.rs:8
↓ 1 callers
Function
error
(message: &str)
creational/singleton/logger/log.rs:38
↓ 1 callers
Method
execute
(&mut self, app: &mut Cursive)
behavioral/command/command/cut.rs:12
↓ 1 callers
Method
handle
(&mut self, patient: &mut Patient)
behavioral/chain-of-responsibility/department/doctor.rs:16
↓ 1 callers
Method
hook1
(&self)
behavioral/template-method/main.rs:24
↓ 1 callers
Method
hook2
(&self)
behavioral/template-method/main.rs:25
↓ 1 callers
Function
init
(max_level: Level)
creational/singleton/logger/simple_logger.rs:17
↓ 1 callers
Function
initialize
()
creational/factory-method/render-dialog/init.rs:5
↓ 1 callers
Method
is_enabled
(&self)
structural/bridge/device/tv.rs:21
↓ 1 callers
Method
log
(&self, level: &Level, message: &str)
creational/singleton/logger/simple_logger.rs:12
↓ 1 callers
Method
mute
(&mut self)
structural/bridge/remotes/advanced.rs:14
↓ 1 callers
Method
next
(&mut self)
behavioral/chain-of-responsibility/department/doctor.rs:25
↓ 1 callers
Method
next
(self: Box<Self>, player: &mut Player)
behavioral/state/state.rs:98
↓ 1 callers
Method
next_track
(&mut self)
behavioral/state/player.rs:41
↓ 1 callers
Method
on_click
(&self)
creational/factory-method/render-dialog/html_gui.rs:11
↓ 1 callers
Method
on_click
(&self)
creational/factory-method/render-dialog/windows_gui.rs:11
↓ 1 callers
Method
parse_str
(&self, input: &str)
behavioral/visitor/main.rs:48
↓ 1 callers
Method
play
(&mut self)
behavioral/state/player.rs:49
↓ 1 callers
Method
play
(&self)
creational/factory-method/maze-game/game.rs:13
next →
1–100 of 277, ranked by callers