-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTreeInterface.php
More file actions
37 lines (27 loc) · 900 Bytes
/
TreeInterface.php
File metadata and controls
37 lines (27 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
/*
* This file is a part of the DiscordPHP-RFC9420 project.
*
* Copyright (c) 2026-present Valithor Obsidion <valithor@discordphp.org>
*
* This file is subject to the MIT license that is bundled
* with this source code in the LICENSE.md file.
*/
namespace MLS\Tree;
use MLS\Commit\UpdatePathInterface;
interface TreeInterface
{
public function getLeafCount(): int;
public function getRootHash(): string;
public function getLeaf(int $index): ?LeafNodeInterface;
public function setLeaf(int $index, LeafNodeInterface $leaf): void;
public function getParent(int $index): ?ParentNodeInterface;
/**
* Compute the path for a leaf index.
*
* @param int $leafIndex
* @return \MLS\Commit\UpdatePathInterface
*/
public function computePath(int $leafIndex): UpdatePathInterface;
}