1: <?php declare(strict_types=1);
2:
3: namespace Salient\Contract\Http\Message;
4:
5: use Psr\Http\Message\StreamInterface as PsrStreamInterface;
6: use Salient\Contract\Core\Immutable;
7: use Salient\Contract\Http\HasMediaType;
8:
9: /**
10: * @api
11: */
12: interface StreamPartInterface extends Immutable, HasMediaType
13: {
14: /**
15: * Get the field name of the part
16: */
17: public function getName(): string;
18:
19: /**
20: * Get an instance with the given field name
21: *
22: * @return static
23: */
24: public function withName(string $name): StreamPartInterface;
25:
26: /**
27: * Get the filename of the part
28: */
29: public function getFilename(): ?string;
30:
31: /**
32: * Get the ASCII filename of the part
33: */
34: public function getAsciiFilename(): ?string;
35:
36: /**
37: * Get the media type of the part
38: */
39: public function getMediaType(): ?string;
40:
41: /**
42: * Get the body of the part
43: */
44: public function getBody(): PsrStreamInterface;
45: }
46: